src/share/classes/java/util/NavigableSet.java

Print this page




 175      * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
 176      * The expression {@code s.descendingSet().descendingSet()} returns a
 177      * view of {@code s} essentially equivalent to {@code s}.
 178      *
 179      * @return a reverse order view of this set
 180      */
 181     NavigableSet<E> descendingSet();
 182 
 183     /**
 184      * Returns an iterator over the elements in this set, in descending order.
 185      * Equivalent in effect to {@code descendingSet().iterator()}.
 186      *
 187      * @return an iterator over the elements in this set, in descending order
 188      */
 189     Iterator<E> descendingIterator();
 190 
 191     /**
 192      * Returns a view of the portion of this set whose elements range from
 193      * {@code fromElement} to {@code toElement}.  If {@code fromElement} and
 194      * {@code toElement} are equal, the returned set is empty unless {@code
 195      * fromExclusive} and {@code toExclusive} are both true.  The returned set
 196      * is backed by this set, so changes in the returned set are reflected in
 197      * this set, and vice-versa.  The returned set supports all optional set
 198      * operations that this set supports.
 199      *
 200      * <p>The returned set will throw an {@code IllegalArgumentException}
 201      * on an attempt to insert an element outside its range.
 202      *
 203      * @param fromElement low endpoint of the returned set
 204      * @param fromInclusive {@code true} if the low endpoint
 205      *        is to be included in the returned view
 206      * @param toElement high endpoint of the returned set
 207      * @param toInclusive {@code true} if the high endpoint
 208      *        is to be included in the returned view
 209      * @return a view of the portion of this set whose elements range from
 210      *         {@code fromElement}, inclusive, to {@code toElement}, exclusive
 211      * @throws ClassCastException if {@code fromElement} and
 212      *         {@code toElement} cannot be compared to one another using this
 213      *         set's comparator (or, if the set has no comparator, using
 214      *         natural ordering).  Implementations may, but are not required
 215      *         to, throw this exception if {@code fromElement} or




 175      * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
 176      * The expression {@code s.descendingSet().descendingSet()} returns a
 177      * view of {@code s} essentially equivalent to {@code s}.
 178      *
 179      * @return a reverse order view of this set
 180      */
 181     NavigableSet<E> descendingSet();
 182 
 183     /**
 184      * Returns an iterator over the elements in this set, in descending order.
 185      * Equivalent in effect to {@code descendingSet().iterator()}.
 186      *
 187      * @return an iterator over the elements in this set, in descending order
 188      */
 189     Iterator<E> descendingIterator();
 190 
 191     /**
 192      * Returns a view of the portion of this set whose elements range from
 193      * {@code fromElement} to {@code toElement}.  If {@code fromElement} and
 194      * {@code toElement} are equal, the returned set is empty unless {@code
 195      * fromInclusive} and {@code toInclusive} are both true.  The returned set
 196      * is backed by this set, so changes in the returned set are reflected in
 197      * this set, and vice-versa.  The returned set supports all optional set
 198      * operations that this set supports.
 199      *
 200      * <p>The returned set will throw an {@code IllegalArgumentException}
 201      * on an attempt to insert an element outside its range.
 202      *
 203      * @param fromElement low endpoint of the returned set
 204      * @param fromInclusive {@code true} if the low endpoint
 205      *        is to be included in the returned view
 206      * @param toElement high endpoint of the returned set
 207      * @param toInclusive {@code true} if the high endpoint
 208      *        is to be included in the returned view
 209      * @return a view of the portion of this set whose elements range from
 210      *         {@code fromElement}, inclusive, to {@code toElement}, exclusive
 211      * @throws ClassCastException if {@code fromElement} and
 212      *         {@code toElement} cannot be compared to one another using this
 213      *         set's comparator (or, if the set has no comparator, using
 214      *         natural ordering).  Implementations may, but are not required
 215      *         to, throw this exception if {@code fromElement} or