src/share/classes/java/util/NavigableMap.java

Print this page




 281     /**
 282      * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
 283      * The set's iterator returns the keys in descending order.
 284      * The set is backed by the map, so changes to the map are reflected in
 285      * the set, and vice-versa.  If the map is modified while an iteration
 286      * over the set is in progress (except through the iterator's own {@code
 287      * remove} operation), the results of the iteration are undefined.  The
 288      * set supports element removal, which removes the corresponding mapping
 289      * from the map, via the {@code Iterator.remove}, {@code Set.remove},
 290      * {@code removeAll}, {@code retainAll}, and {@code clear} operations.
 291      * It does not support the {@code add} or {@code addAll} operations.
 292      *
 293      * @return a reverse order navigable set view of the keys in this map
 294      */
 295     NavigableSet<K> descendingKeySet();
 296 
 297     /**
 298      * Returns a view of the portion of this map whose keys range from
 299      * {@code fromKey} to {@code toKey}.  If {@code fromKey} and
 300      * {@code toKey} are equal, the returned map is empty unless
 301      * {@code fromExclusive} and {@code toExclusive} are both true.  The
 302      * returned map is backed by this map, so changes in the returned map are
 303      * reflected in this map, and vice-versa.  The returned map supports all
 304      * optional map operations that this map supports.
 305      *
 306      * <p>The returned map will throw an {@code IllegalArgumentException}
 307      * on an attempt to insert a key outside of its range, or to construct a
 308      * submap either of whose endpoints lie outside its range.
 309      *
 310      * @param fromKey low endpoint of the keys in the returned map
 311      * @param fromInclusive {@code true} if the low endpoint
 312      *        is to be included in the returned view
 313      * @param toKey high endpoint of the keys in the returned map
 314      * @param toInclusive {@code true} if the high endpoint
 315      *        is to be included in the returned view
 316      * @return a view of the portion of this map whose keys range from
 317      *         {@code fromKey} to {@code toKey}
 318      * @throws ClassCastException if {@code fromKey} and {@code toKey}
 319      *         cannot be compared to one another using this map's comparator
 320      *         (or, if the map has no comparator, using natural ordering).
 321      *         Implementations may, but are not required to, throw this




 281     /**
 282      * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
 283      * The set's iterator returns the keys in descending order.
 284      * The set is backed by the map, so changes to the map are reflected in
 285      * the set, and vice-versa.  If the map is modified while an iteration
 286      * over the set is in progress (except through the iterator's own {@code
 287      * remove} operation), the results of the iteration are undefined.  The
 288      * set supports element removal, which removes the corresponding mapping
 289      * from the map, via the {@code Iterator.remove}, {@code Set.remove},
 290      * {@code removeAll}, {@code retainAll}, and {@code clear} operations.
 291      * It does not support the {@code add} or {@code addAll} operations.
 292      *
 293      * @return a reverse order navigable set view of the keys in this map
 294      */
 295     NavigableSet<K> descendingKeySet();
 296 
 297     /**
 298      * Returns a view of the portion of this map whose keys range from
 299      * {@code fromKey} to {@code toKey}.  If {@code fromKey} and
 300      * {@code toKey} are equal, the returned map is empty unless
 301      * {@code fromInclusive} and {@code toInclusive} are both true.  The
 302      * returned map is backed by this map, so changes in the returned map are
 303      * reflected in this map, and vice-versa.  The returned map supports all
 304      * optional map operations that this map supports.
 305      *
 306      * <p>The returned map will throw an {@code IllegalArgumentException}
 307      * on an attempt to insert a key outside of its range, or to construct a
 308      * submap either of whose endpoints lie outside its range.
 309      *
 310      * @param fromKey low endpoint of the keys in the returned map
 311      * @param fromInclusive {@code true} if the low endpoint
 312      *        is to be included in the returned view
 313      * @param toKey high endpoint of the keys in the returned map
 314      * @param toInclusive {@code true} if the high endpoint
 315      *        is to be included in the returned view
 316      * @return a view of the portion of this map whose keys range from
 317      *         {@code fromKey} to {@code toKey}
 318      * @throws ClassCastException if {@code fromKey} and {@code toKey}
 319      *         cannot be compared to one another using this map's comparator
 320      *         (or, if the map has no comparator, using natural ordering).
 321      *         Implementations may, but are not required to, throw this