ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/NavigableMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/NavigableMap.java (file contents):
Revision 1.14 by dl, Wed Apr 19 15:07:14 2006 UTC vs.
Revision 1.19 by jsr166, Fri Apr 21 21:37:48 2006 UTC

# Line 23 | Line 23 | package java.util;
23   * method returns a view of the map with the senses of all relational
24   * and directional methods inverted. The performance of ascending
25   * operations and views is likely to be faster than that of descending
26 < * ones.  Methods {@code navigableSubMap}, {@code navigableHeadMap},
27 < * and {@code navigableTailMap} differ from the similarly named {@code
26 > * ones.  Methods {@code subMap}, {@code headMap},
27 > * and {@code tailMap} differ from the like-named {@code
28   * SortedMap} methods in accepting additional arguments describing
29   * whether lower and upper bounds are inclusive versus exclusive.
30   * Submaps of any {@code NavigableMap} must implement the {@code
# Line 208 | Line 208 | public interface NavigableMap<K,V> exten
208      /**
209       * Returns a {@link NavigableMap} view of the mappings contained in this
210       * map in descending order.  The descending map is backed by this map, so
211 <     * changes to the map are reflected in the descending set, and vice-versa.
211 >     * changes to the map are reflected in the descending map, and vice-versa.
212       * If either map is modified while an iteration over a collection view of
213       * the other map is in progress (except through the iterator's own
214       * {@code remove} operation), the results of the iteration are undefined.
# Line 226 | Line 226 | public interface NavigableMap<K,V> exten
226       * {@code remove} operation), the results of the iteration are undefined.
227       * The set supports element removal, which removes the corresponding
228       * mapping from the map, via the {@code Iterator.remove},
229 <     * {@code Set.remove}, {@code removeAll} {@code retainAll}, and
229 >     * {@code Set.remove}, {@code removeAll}, {@code retainAll}, and
230       * {@code clear} operations.  It does not support the {@code add} or
231       * {@code addAll} operations.
232       *
# Line 267 | Line 267 | public interface NavigableMap<K,V> exten
267       * submap either of whose endpoints lie outside its range.
268       *
269       * @param fromKey low endpoint of the keys in the returned map
270 <     * @param fromInclusive true if the low endpoint ({@code fromKey}) is
271 <     *        to be included in the the returned view
270 >     * @param fromInclusive {@code true} if the low endpoint
271 >     *        is to be included in the returned view
272       * @param toKey high endpoint of the keys in the returned map
273 <     * @param toInclusive true if the high endpoint ({@code toKey}) is
274 <     *        to be included in the the returned view
273 >     * @param toInclusive {@code true} if the high endpoint
274 >     *        is to be included in the returned view
275       * @return a view of the portion of this map whose keys range from
276       *         {@code fromKey} to {@code toKey}
277       * @throws ClassCastException if {@code fromKey} and {@code toKey}
# Line 287 | Line 287 | public interface NavigableMap<K,V> exten
287       *         range, and {@code fromKey} or {@code toKey} lies
288       *         outside the bounds of the range
289       */
290 <    NavigableMap<K,V> navigableSubMap(K fromKey, boolean fromInclusive,
291 <                                      K toKey,   boolean toInclusive);
290 >    NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive,
291 >                             K toKey,   boolean toInclusive);
292  
293      /**
294       * Returns a view of the portion of this map whose keys are less than (or
# Line 301 | Line 301 | public interface NavigableMap<K,V> exten
301       * on an attempt to insert a key outside its range.
302       *
303       * @param toKey high endpoint of the keys in the returned map
304 <     * @param inclusive true if the high endpoint ({@code toKey}) is
305 <     *        to be included in the the returned view
304 >     * @param inclusive {@code true} if the high endpoint
305 >     *        is to be included in the returned view
306       * @return a view of the portion of this map whose keys are less than
307       *         (or equal to, if {@code inclusive} is true) {@code toKey}
308       * @throws ClassCastException if {@code toKey} is not compatible
# Line 317 | Line 317 | public interface NavigableMap<K,V> exten
317       *         restricted range, and {@code toKey} lies outside the
318       *         bounds of the range
319       */
320 <    NavigableMap<K,V> navigableHeadMap(K toKey, boolean inclusive);
320 >    NavigableMap<K,V> headMap(K toKey, boolean inclusive);
321  
322      /**
323       * Returns a view of the portion of this map whose keys are greater than (or
# Line 330 | Line 330 | public interface NavigableMap<K,V> exten
330       * on an attempt to insert a key outside its range.
331       *
332       * @param fromKey low endpoint of the keys in the returned map
333 <     * @param inclusive true if the low endpoint ({@code fromKey}) is
334 <     *        to be included in the the returned view
333 >     * @param inclusive {@code true} if the low endpoint
334 >     *        is to be included in the returned view
335       * @return a view of the portion of this map whose keys are greater than
336       *         (or equal to, if {@code inclusive} is true) {@code fromKey}
337       * @throws ClassCastException if {@code fromKey} is not compatible
# Line 346 | Line 346 | public interface NavigableMap<K,V> exten
346       *         restricted range, and {@code fromKey} lies outside the
347       *         bounds of the range
348       */
349 <    NavigableMap<K,V> navigableTailMap(K fromKey, boolean inclusive);
349 >    NavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
350 >
351 >    /**
352 >     * Equivalent to {@code subMap(fromKey, true, toKey, false)}
353 >     * but with a return type conforming to the {@code SortedMap} interface.
354 >     *
355 >     * <p>{@inheritDoc}
356 >     *
357 >     * @throws ClassCastException       {@inheritDoc}
358 >     * @throws NullPointerException     {@inheritDoc}
359 >     * @throws IllegalArgumentException {@inheritDoc}
360 >     */
361 >    SortedMap<K,V> subMap(K fromKey, K toKey);
362 >
363 >    /**
364 >     * Equivalent to {@code headMap(toKey, false)}
365 >     * but with a return type conforming to the {@code SortedMap} interface.
366 >     *
367 >     * <p>{@inheritDoc}
368 >     *
369 >     * @throws ClassCastException       {@inheritDoc}
370 >     * @throws NullPointerException     {@inheritDoc}
371 >     * @throws IllegalArgumentException {@inheritDoc}
372 >     */
373 >    SortedMap<K,V> headMap(K toKey);
374 >
375 >    /**
376 >     * Equivalent to {@code tailMap(fromKey, true)}
377 >     * but with a return type conforming to the {@code SortedMap} interface.
378 >     *
379 >     * <p>{@inheritDoc}
380 >     *
381 >     * @throws ClassCastException       {@inheritDoc}
382 >     * @throws NullPointerException     {@inheritDoc}
383 >     * @throws IllegalArgumentException {@inheritDoc}
384 >     */
385 >    SortedMap<K,V> tailMap(K fromKey);
386   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines