Warning
The methods of ForwardingNavigableSet forward indiscriminately
to the methods of the delegate. For example, overriding add alone will not change
the behavior of addAll, which can lead to unexpected behavior. In this case, you should
override addAll as well, either providing your own implementation, or delegating to the
provided standardAddAll method.
default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations
invoke methods, they invoke methods on the ForwardingNavigableSet.
Each of the standard methods uses the set's comparator (or the natural ordering of the
elements, if there is no comparator) to test element equality. As a result, if the comparator is
not consistent with equals, some of the standard implementations may violate the Set
contract.
The standard methods and the collection views they return are not guaranteed to be
thread-safe, even when all of the methods that they depend on are thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| protected class | ForwardingNavigableSet.StandardDescendingSet
A sensible implementation of |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public E | ceiling(E
the value to match e)Implements java. null if there is no such element.
|
| protected abstract NavigableSet | delegate()
Implements abstract com. |
| public Iterator | descendingIterator()
Implements java. |
| public NavigableSet | descendingSet()
Implements java. |
| public E | floor(E
the value to match e)Implements java. null if there is no such element.
|
| public NavigableSet | headSet(E
high endpoint of the returned set toElement, boolean true if the high endpoint
is to be included in the returned viewImplements java. inclusive is true) toElement.
|
| public E | higher(E
the value to match e)Implements java. null if there is no such element.
|
| public E | lower(E
the value to match e)Implements java. null if there is no such element.
|
| public E | pollFirst()
Implements java. null if this set is empty.
|
| public E | pollLast()
Implements java. null if this set is empty.
|
| protected E | standardCeiling(E e)
A sensible definition of |
| protected E | |
| protected E | standardFloor(E e)
A sensible definition of |
| protected SortedSet | standardHeadSet(E toElement)
A sensible definition of |
| protected E | standardHigher(E e)
A sensible definition of |
| protected E | |
| protected E | standardLower(E e)
A sensible definition of |
| protected E | |
| protected E | |
| protected NavigableSet | standardSubSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
A sensible definition of |
| protected SortedSet | standardSubSet(E fromElement, E toElement)
Overrides com. subSet(Object, Object) in terms of the subSet(Object,
boolean, Object, boolean) method.
|
| protected SortedSet | standardTailSet(E fromElement)
A sensible definition of |
| public NavigableSet | subSet(E
low endpoint of the returned set fromElement, boolean true if the low endpoint
is to be included in the returned viewhigh endpoint of the returned set toElement, boolean true if the high endpoint
is to be included in the returned viewImplements java. fromElement to toElement.
|
| public NavigableSet | tailSet(E
low endpoint of the returned set fromElement, boolean true if the low endpoint
is to be included in the returned viewImplements java. inclusive is true) fromElement.
|
| ForwardingNavigableSet | back to summary |
|---|---|
| protected ForwardingNavigableSet() Constructor for use by subclasses. | |
| ceiling | back to summary |
|---|---|
| public E ceiling(E e) Implements java. Doc from java. Returns the least element in this set greater than or equal to
the given element, or
| |
| delegate | back to summary |
|---|---|
| protected abstract NavigableSet Implements abstract com. Doc from com. Returns the backing delegate instance that methods are forwarded to. Abstract subclasses
generally override this method with an abstract method that has a more specific return type,
such as
| |
| descendingIterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over the elements in this set, in descending order.
Equivalent in effect to | |
| descendingSet | back to summary |
|---|---|
| public NavigableSet Implements java. Doc from java. Returns a reverse order view of the elements contained in this set.
The descending set is backed by this set, so changes to the set are
reflected in the descending set, and vice-versa. If either set is
modified while an iteration over either set is in progress (except
through the iterator's own The returned set has an ordering equivalent to
| |
| floor | back to summary |
|---|---|
| public E floor(E e) Implements java. Doc from java. Returns the greatest element in this set less than or equal to
the given element, or
| |
| headSet | back to summary |
|---|---|
| public NavigableSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are less than
(or equal to, if The returned set will throw an
| |
| higher | back to summary |
|---|---|
| public E higher(E e) Implements java. Doc from java. Returns the least element in this set strictly greater than the
given element, or
| |
| lower | back to summary |
|---|---|
| public E lower(E e) Implements java. Doc from java. Returns the greatest element in this set strictly less than the
given element, or
| |
| pollFirst | back to summary |
|---|---|
| public E pollFirst() Implements java. Doc from java. Retrieves and removes the first (lowest) element,
or returns
| |
| pollLast | back to summary |
|---|---|
| public E pollLast() Implements java. Doc from java. Retrieves and removes the last (highest) element,
or returns
| |
| standardCeiling | back to summary |
|---|---|
| protected E standardCeiling(E e) A sensible definition of
| |
| standardFirst | back to summary |
|---|---|
protected E standardFirst()
| |
| standardFloor | back to summary |
|---|---|
| protected E standardFloor(E e) A sensible definition of
| |
| standardHeadSet | back to summary |
|---|---|
| protected SortedSet A sensible definition of | |
| standardHigher | back to summary |
|---|---|
| protected E standardHigher(E e) A sensible definition of
| |
| standardLast | back to summary |
|---|---|
protected E standardLast()
| |
| standardLower | back to summary |
|---|---|
| protected E standardLower(E e) A sensible definition of
| |
| standardPollFirst | back to summary |
|---|---|
| protected E standardPollFirst() A sensible definition of
| |
| standardPollLast | back to summary |
|---|---|
| protected E standardPollLast() A sensible definition of
| |
| standardSubSet | back to summary |
|---|---|
| protected NavigableSet A sensible definition of | |
| standardSubSet | back to summary |
|---|---|
| protected SortedSet Overrides com. A sensible definition of
| |
| standardTailSet | back to summary |
|---|---|
| protected SortedSet A sensible definition of | |
| subSet | back to summary |
|---|---|
| public NavigableSet Implements java. Doc from java. Returns a view of the portion of this set whose elements range from
The returned set will throw an
| |
| tailSet | back to summary |
|---|---|
| public NavigableSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are greater
than (or equal to, if The returned set will throw an
| |
NavigableSet#descendingSet in terms of the other methods
of NavigableSet, notably including NavigableSet#descendingIterator.
In many cases, you may wish to override ForwardingNavigableSet#descendingSet to
forward to this implementation or a subclass thereof.