Warning
The methods of ForwardingSortedSet 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 ForwardingSortedSet.
Each of the standard methods, where appropriate, 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.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Comparator | comparator()
Implements java. null if this set uses the natural ordering of its elements.
|
| protected abstract SortedSet | delegate()
Implements abstract com. |
| public E | first()
Implements java. |
| public SortedSet | headSet(E
high endpoint (exclusive) of the returned set toElement)Implements java. toElement.
|
| public E | last()
Implements java. |
| protected boolean | standardContains(Object object)
Overrides com. contains in terms of the first() method of tailSet.
|
| protected boolean | standardRemove(Object object)
Overrides com. remove in terms of the iterator() method of tailSet.
|
| protected SortedSet | standardSubSet(E fromElement, E toElement)
A sensible default implementation of |
| public SortedSet | subSet(E
low endpoint (inclusive) of the returned set fromElement, E high endpoint (exclusive) of the returned set toElement)Implements java. fromElement, inclusive, to toElement,
exclusive.
|
| public SortedSet | tailSet(E
low endpoint (inclusive) of the returned set fromElement)Implements java. fromElement.
|
| ForwardingSortedSet | back to summary |
|---|---|
| protected ForwardingSortedSet() Constructor for use by subclasses. | |
| comparator | back to summary |
|---|---|
| public Comparator Implements java. Doc from java. Returns the comparator used to order the elements in this set,
or
| |
| delegate | back to summary |
|---|---|
| protected abstract SortedSet 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
| |
| first | back to summary |
|---|---|
| public E first() Implements java. Doc from java. Returns the first (lowest) element currently in this set.
| |
| headSet | back to summary |
|---|---|
| public SortedSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are
strictly less than The returned set will throw an | |
| last | back to summary |
|---|---|
| public E last() Implements java. Doc from java. Returns the last (highest) element currently in this set.
| |
| standardContains | back to summary |
|---|---|
| protected boolean standardContains(Object object) Overrides com. A sensible definition of
| |
| standardRemove | back to summary |
|---|---|
| protected boolean standardRemove(Object object) Overrides com. A sensible definition of
| |
| standardSubSet | back to summary |
|---|---|
| protected SortedSet A sensible default implementation of
| |
| subSet | back to summary |
|---|---|
| public SortedSet 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 SortedSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are
greater than or equal to The returned set will throw an | |