Class ForwardingNavigableSet.StandardDescendingSet
- java.lang.Object
- 
- com.google.common.collect.ForwardingObject
- 
- com.google.common.collect.ForwardingCollection<E>
- 
- com.google.common.collect.ForwardingSet<E>
- 
- com.google.common.collect.ForwardingSortedSet<E>
- 
- com.google.common.collect.ForwardingNavigableSet<E>
- 
- com.google.common.collect.ForwardingNavigableSet.StandardDescendingSet
 
 
 
 
 
 
- 
- All Implemented Interfaces:
- Iterable<E>,- Collection<E>,- NavigableSet<E>,- Set<E>,- SortedSet<E>
 - Enclosing class:
- ForwardingNavigableSet<E extends @Nullable Object>
 
 @Beta protected class ForwardingNavigableSet.StandardDescendingSet extends ForwardingNavigableSet<E> A sensible implementation ofNavigableSet.descendingSet()in terms of the other methods ofNavigableSet, notably includingNavigableSet.descendingIterator().In many cases, you may wish to override ForwardingNavigableSet.descendingSet()to forward to this implementation or a subclass thereof.- Since:
- 12.0
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.google.common.collect.ForwardingNavigableSetForwardingNavigableSet.StandardDescendingSet
 
- 
 - 
Constructor SummaryConstructors Constructor Description StandardDescendingSet()Constructor for use by subclasses.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Eceiling(E e)Returns the least element in this set greater than or equal to the given element, ornullif there is no such element.Comparator<? super E>comparator()Returns the comparator used to order the elements in this set, ornullif this set uses the natural ordering of its elements.protected NavigableSet<E>delegate()Returns the backing delegate instance that methods are forwarded to.Iterator<E>descendingIterator()Returns an iterator over the elements in this set, in descending order.NavigableSet<E>descendingSet()Returns a reverse order view of the elements contained in this set.Efirst()Returns the first (lowest) element currently in this set.Efloor(E e)Returns the greatest element in this set less than or equal to the given element, ornullif there is no such element.SortedSet<E>headSet(E toElement)Returns a view of the portion of this set whose elements are strictly less thantoElement.NavigableSet<E>headSet(E toElement, boolean inclusive)Returns a view of the portion of this set whose elements are less than (or equal to, ifinclusiveis true)toElement.Ehigher(E e)Returns the least element in this set strictly greater than the given element, ornullif there is no such element.Iterator<E>iterator()Returns an iterator over the elements in this collection.Elast()Returns the last (highest) element currently in this set.Elower(E e)Returns the greatest element in this set strictly less than the given element, ornullif there is no such element.EpollFirst()Retrieves and removes the first (lowest) element, or returnsnullif this set is empty.EpollLast()Retrieves and removes the last (highest) element, or returnsnullif this set is empty.NavigableSet<E>subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)Returns a view of the portion of this set whose elements range fromfromElementtotoElement.SortedSet<E>subSet(E fromElement, E toElement)Returns a view of the portion of this set whose elements range fromfromElement, inclusive, totoElement, exclusive.SortedSet<E>tailSet(E fromElement)Returns a view of the portion of this set whose elements are greater than or equal tofromElement.NavigableSet<E>tailSet(E fromElement, boolean inclusive)Returns a view of the portion of this set whose elements are greater than (or equal to, ifinclusiveis true)fromElement.@Nullable Object[]toArray()Returns an array containing all of the elements in this collection.<T extends @Nullable Object>
 T[]toArray(T[] array)Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.StringtoString()Returns the string representation generated by the delegate'stoStringmethod.- 
Methods inherited from class com.google.common.collect.ForwardingNavigableSetstandardCeiling, standardFirst, standardFloor, standardHeadSet, standardHigher, standardLast, standardLower, standardPollFirst, standardPollLast, standardSubSet, standardSubSet, standardTailSet
 - 
Methods inherited from class com.google.common.collect.ForwardingSortedSetstandardContains, standardRemove
 - 
Methods inherited from class com.google.common.collect.ForwardingSetequals, hashCode, standardEquals, standardHashCode, standardRemoveAll
 - 
Methods inherited from class com.google.common.collect.ForwardingCollectionadd, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContainsAll, standardIsEmpty, standardRetainAll, standardToArray, standardToArray, standardToString
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
 - 
Methods inherited from interface java.util.Setadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size
 - 
Methods inherited from interface java.util.SortedSetspliterator
 
- 
 
- 
- 
- 
Constructor Detail- 
StandardDescendingSetpublic StandardDescendingSet() Constructor for use by subclasses.
 
- 
 - 
Method Detail- 
delegateprotected NavigableSet<E> delegate() Description copied from class:ForwardingObjectReturns 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 asForwardingSet.delegate(). Concrete subclasses override this method to supply the instance being decorated.- Specified by:
- delegatein class- ForwardingNavigableSet<E extends @Nullable Object>
 
 - 
lower@CheckForNull public E lower(E e) Description copied from interface:java.util.NavigableSetReturns the greatest element in this set strictly less than the given element, ornullif there is no such element.- Specified by:
- lowerin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- lowerin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- e- the value to match
- Returns:
- the greatest element less than e, ornullif there is no such element
 
 - 
floor@CheckForNull public E floor(E e) Description copied from interface:java.util.NavigableSetReturns the greatest element in this set less than or equal to the given element, ornullif there is no such element.- Specified by:
- floorin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- floorin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- e- the value to match
- Returns:
- the greatest element less than or equal to e, ornullif there is no such element
 
 - 
ceiling@CheckForNull public E ceiling(E e) Description copied from interface:java.util.NavigableSetReturns the least element in this set greater than or equal to the given element, ornullif there is no such element.- Specified by:
- ceilingin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- ceilingin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- e- the value to match
- Returns:
- the least element greater than or equal to e, ornullif there is no such element
 
 - 
higher@CheckForNull public E higher(E e) Description copied from interface:java.util.NavigableSetReturns the least element in this set strictly greater than the given element, ornullif there is no such element.- Specified by:
- higherin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- higherin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- e- the value to match
- Returns:
- the least element greater than e, ornullif there is no such element
 
 - 
pollFirst@CheckForNull public E pollFirst() Description copied from interface:java.util.NavigableSetRetrieves and removes the first (lowest) element, or returnsnullif this set is empty.- Specified by:
- pollFirstin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- pollFirstin class- ForwardingNavigableSet<E extends @Nullable Object>
- Returns:
- the first element, or nullif this set is empty
 
 - 
pollLast@CheckForNull public E pollLast() Description copied from interface:java.util.NavigableSetRetrieves and removes the last (highest) element, or returnsnullif this set is empty.- Specified by:
- pollLastin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- pollLastin class- ForwardingNavigableSet<E extends @Nullable Object>
- Returns:
- the last element, or nullif this set is empty
 
 - 
descendingSetpublic NavigableSet<E> descendingSet() Description copied from interface:java.util.NavigableSetReturns 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 ownremoveoperation), the results of the iteration are undefined.The returned set has an ordering equivalent to Collections.reverseOrder(comparator()). The expressions.descendingSet().descendingSet()returns a view ofsessentially equivalent tos.- Specified by:
- descendingSetin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- descendingSetin class- ForwardingNavigableSet<E extends @Nullable Object>
- Returns:
- a reverse order view of this set
 
 - 
descendingIteratorpublic Iterator<E> descendingIterator() Description copied from interface:java.util.NavigableSetReturns an iterator over the elements in this set, in descending order. Equivalent in effect todescendingSet().iterator().- Specified by:
- descendingIteratorin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- descendingIteratorin class- ForwardingNavigableSet<E extends @Nullable Object>
- Returns:
- an iterator over the elements in this set, in descending order
 
 - 
subSetpublic NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) Description copied from interface:java.util.NavigableSetReturns a view of the portion of this set whose elements range fromfromElementtotoElement. IffromElementandtoElementare equal, the returned set is empty unlessfromInclusiveandtoInclusiveare both true. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- subSetin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- subSetin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- fromElement- low endpoint of the returned set
- fromInclusive-- trueif the low endpoint is to be included in the returned view
- toElement- high endpoint of the returned set
- toInclusive-- trueif the high endpoint is to be included in the returned view
- Returns:
- a view of the portion of this set whose elements range from
         fromElement, inclusive, totoElement, exclusive
 
 - 
subSetpublic SortedSet<E> subSet(E fromElement, E toElement) Description copied from interface:java.util.SortedSetReturns a view of the portion of this set whose elements range fromfromElement, inclusive, totoElement, exclusive. (IffromElementandtoElementare equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- subSetin interface- NavigableSet<E extends @Nullable Object>
- Specified by:
- subSetin interface- SortedSet<E extends @Nullable Object>
- Overrides:
- subSetin class- ForwardingSortedSet<E extends @Nullable Object>
- Parameters:
- fromElement- low endpoint (inclusive) of the returned set
- toElement- high endpoint (exclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements range from
         fromElement, inclusive, totoElement, exclusive
 
 - 
headSetpublic NavigableSet<E> headSet(E toElement, boolean inclusive) Description copied from interface:java.util.NavigableSetReturns a view of the portion of this set whose elements are less than (or equal to, ifinclusiveis true)toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- headSetin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- headSetin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- toElement- high endpoint of the returned set
- inclusive-- trueif the high endpoint is to be included in the returned view
- Returns:
- a view of the portion of this set whose elements are less than
         (or equal to, if inclusiveis true)toElement
 
 - 
headSetpublic SortedSet<E> headSet(E toElement) Description copied from interface:java.util.SortedSetReturns a view of the portion of this set whose elements are strictly less thantoElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- headSetin interface- NavigableSet<E extends @Nullable Object>
- Specified by:
- headSetin interface- SortedSet<E extends @Nullable Object>
- Overrides:
- headSetin class- ForwardingSortedSet<E extends @Nullable Object>
- Parameters:
- toElement- high endpoint (exclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements are strictly
         less than toElement
 
 - 
tailSetpublic NavigableSet<E> tailSet(E fromElement, boolean inclusive) Description copied from interface:java.util.NavigableSetReturns a view of the portion of this set whose elements are greater than (or equal to, ifinclusiveis true)fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- tailSetin interface- NavigableSet<E extends @Nullable Object>
- Overrides:
- tailSetin class- ForwardingNavigableSet<E extends @Nullable Object>
- Parameters:
- fromElement- low endpoint of the returned set
- inclusive-- trueif the low endpoint is to be included in the returned view
- Returns:
- a view of the portion of this set whose elements are greater
         than or equal to fromElement
 
 - 
tailSetpublic SortedSet<E> tailSet(E fromElement) Description copied from interface:java.util.SortedSetReturns a view of the portion of this set whose elements are greater than or equal tofromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.The returned set will throw an IllegalArgumentExceptionon an attempt to insert an element outside its range.- Specified by:
- tailSetin interface- NavigableSet<E extends @Nullable Object>
- Specified by:
- tailSetin interface- SortedSet<E extends @Nullable Object>
- Overrides:
- tailSetin class- ForwardingSortedSet<E extends @Nullable Object>
- Parameters:
- fromElement- low endpoint (inclusive) of the returned set
- Returns:
- a view of the portion of this set whose elements are greater
         than or equal to fromElement
 
 - 
comparatorpublic Comparator<? super E> comparator() Description copied from interface:java.util.SortedSetReturns the comparator used to order the elements in this set, ornullif this set uses the natural ordering of its elements.- Specified by:
- comparatorin interface- SortedSet<E extends @Nullable Object>
- Overrides:
- comparatorin class- ForwardingSortedSet<E extends @Nullable Object>
- Returns:
- the comparator used to order the elements in this set,
         or nullif this set uses the natural ordering of its elements
 
 - 
firstpublic E first() Description copied from interface:java.util.SortedSetReturns the first (lowest) element currently in this set.
 - 
lastpublic E last() Description copied from interface:java.util.SortedSetReturns the last (highest) element currently in this set.
 - 
iteratorpublic Iterator<E> iterator() Description copied from interface:java.util.CollectionReturns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned (unless this collection is an instance of some class that provides a guarantee).- Specified by:
- iteratorin interface- Collection<E extends @Nullable Object>
- Specified by:
- iteratorin interface- Iterable<E extends @Nullable Object>
- Specified by:
- iteratorin interface- NavigableSet<E extends @Nullable Object>
- Specified by:
- iteratorin interface- Set<E extends @Nullable Object>
- Overrides:
- iteratorin class- ForwardingCollection<E extends @Nullable Object>
- Returns:
- an Iteratorover the elements in this collection
 
 - 
toArraypublic @Nullable Object[] toArray() Description copied from interface:java.util.CollectionReturns an array containing all of the elements in this collection. If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array's runtime component type isObject.The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array. - Specified by:
- toArrayin interface- Collection<E extends @Nullable Object>
- Specified by:
- toArrayin interface- Set<E extends @Nullable Object>
- Overrides:
- toArrayin class- ForwardingCollection<E extends @Nullable Object>
- Returns:
- an array, whose runtime component
 type is Object, containing all of the elements in this collection
 
 - 
toArraypublic <T extends @Nullable Object> T[] toArray(T[] array) Description copied from interface:java.util.CollectionReturns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array. If the collection fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.If this collection fits in the specified array with room to spare (i.e., the array has more elements than this collection), the element in the array immediately following the end of the collection is set to null. (This is useful in determining the length of this collection only if the caller knows that this collection does not contain anynullelements.)If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. - Specified by:
- toArrayin interface- Collection<E extends @Nullable Object>
- Specified by:
- toArrayin interface- Set<E extends @Nullable Object>
- Overrides:
- toArrayin class- ForwardingCollection<E extends @Nullable Object>
- Type Parameters:
- T- the component type of the array to contain the collection
- Parameters:
- array- the array into which the elements of this collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
- Returns:
- an array containing all of the elements in this collection
 
 - 
toStringpublic String toString() Description copied from class:ForwardingObjectReturns the string representation generated by the delegate'stoStringmethod.- Overrides:
- toStringin class- ForwardingObject
- Returns:
- a string representation of the object.
 
 
- 
 
-