Class ForwardingNavigableSet.StandardDescendingSet

    • Method Detail

      • descendingSet

        public NavigableSet<E> descendingSet()
        Description copied from interface: java.util.NavigableSet
        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 remove operation), the results of the iteration are undefined.

        The returned set has an ordering equivalent to Collections.reverseOrder(comparator()). The expression s.descendingSet().descendingSet() returns a view of s essentially equivalent to s.

        Specified by:
        descendingSet in interface NavigableSet<E extends @Nullable Object>
        Overrides:
        descendingSet in class ForwardingNavigableSet<E extends @Nullable Object>
        Returns:
        a reverse order view of this set
      • subSet

        public NavigableSet<E> subSet​(E fromElement,
                                      boolean fromInclusive,
                                      E toElement,
                                      boolean toInclusive)
        Description copied from interface: java.util.NavigableSet
        Returns a view of the portion of this set whose elements range from fromElement to toElement. If fromElement and toElement are equal, the returned set is empty unless fromInclusive and toInclusive are 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        subSet in interface NavigableSet<E extends @Nullable Object>
        Overrides:
        subSet in class ForwardingNavigableSet<E extends @Nullable Object>
        Parameters:
        fromElement - low endpoint of the returned set
        fromInclusive - true if the low endpoint is to be included in the returned view
        toElement - high endpoint of the returned set
        toInclusive - true if 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, to toElement, exclusive
      • subSet

        public SortedSet<E> subSet​(E fromElement,
                                   E toElement)
        Description copied from interface: java.util.SortedSet
        Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        subSet in interface NavigableSet<E extends @Nullable Object>
        Specified by:
        subSet in interface SortedSet<E extends @Nullable Object>
        Overrides:
        subSet in 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, to toElement, exclusive
      • headSet

        public NavigableSet<E> headSet​(E toElement,
                                       boolean inclusive)
        Description copied from interface: java.util.NavigableSet
        Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        headSet in interface NavigableSet<E extends @Nullable Object>
        Overrides:
        headSet in class ForwardingNavigableSet<E extends @Nullable Object>
        Parameters:
        toElement - high endpoint of the returned set
        inclusive - true if 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 inclusive is true) toElement
      • headSet

        public SortedSet<E> headSet​(E toElement)
        Description copied from interface: java.util.SortedSet
        Returns a view of the portion of this set whose elements are strictly less than 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        headSet in interface NavigableSet<E extends @Nullable Object>
        Specified by:
        headSet in interface SortedSet<E extends @Nullable Object>
        Overrides:
        headSet in 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
      • tailSet

        public NavigableSet<E> tailSet​(E fromElement,
                                       boolean inclusive)
        Description copied from interface: java.util.NavigableSet
        Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        tailSet in interface NavigableSet<E extends @Nullable Object>
        Overrides:
        tailSet in class ForwardingNavigableSet<E extends @Nullable Object>
        Parameters:
        fromElement - low endpoint of the returned set
        inclusive - true if 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
      • tailSet

        public SortedSet<E> tailSet​(E fromElement)
        Description copied from interface: java.util.SortedSet
        Returns a view of the portion of this set whose elements are greater than or equal to 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 IllegalArgumentException on an attempt to insert an element outside its range.

        Specified by:
        tailSet in interface NavigableSet<E extends @Nullable Object>
        Specified by:
        tailSet in interface SortedSet<E extends @Nullable Object>
        Overrides:
        tailSet in 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
      • toArray

        public @Nullable Object[] toArray()
        Description copied from interface: java.util.Collection
        Returns 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 is Object.

        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:
        toArray in interface Collection<E extends @Nullable Object>
        Specified by:
        toArray in interface Set<E extends @Nullable Object>
        Overrides:
        toArray in class ForwardingCollection<E extends @Nullable Object>
        Returns:
        an array, whose runtime component type is Object, containing all of the elements in this collection
      • toArray

        public <T extends @Nullable Object> T[] toArray​(T[] array)
        Description copied from interface: java.util.Collection
        Returns 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 any null elements.)

        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:
        toArray in interface Collection<E extends @Nullable Object>
        Specified by:
        toArray in interface Set<E extends @Nullable Object>
        Overrides:
        toArray in 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
      • toString

        public String toString()
        Description copied from class: ForwardingObject
        Returns the string representation generated by the delegate's toString method.
        Overrides:
        toString in class ForwardingObject
        Returns:
        a string representation of the object.