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.3 by dl, Tue Mar 22 01:30:10 2005 UTC vs.
Revision 1.6 by jsr166, Mon May 2 22:34:56 2005 UTC

# Line 25 | Line 25 | package java.util;
25   * <tt>descendingEntrySet</tt> return descending views. The
26   * performance of ascending traversals is likely to be faster than
27   * descending traversals.  Notice that it is possible to perform
28 < * subrange traversals in either direction using <tt>SubMap</tt>.
29 < *
28 > * subrange traversals in either direction using <tt>navigableSubMap</tt>.
29 > * Methods <tt>navigableSubMap</tt>, <tt>navigableHeadMap</tt>, and
30 > * <tt>navigableTailMap</tt> differ from the similarly named
31 > * <tt>SortedMap</tt> methods only in that the returned maps
32 > * are guaranteed to obey the <tt>NavigableMap</tt> interface.
33 > *
34   * <p>This interface additionally defines methods <tt>firstEntry</tt>,
35   * <tt>pollFirstEntry</tt>, <tt>lastEntry</tt>, and
36   * <tt>pollLastEntry</tt> that return and/or remove the least and
# Line 41 | Line 45 | package java.util;
45   *
46   * @author Doug Lea
47   * @param <K> the type of keys maintained by this map
48 < * @param <V> the type of mapped values
48 > * @param <V> the type of mapped values
49 > * @since 1.6
50   */
51   public interface NavigableMap<K,V> extends SortedMap<K,V> {
52      /**
53       * Returns a key-value mapping associated with the least key
54       * greater than or equal to the given key, or <tt>null</tt> if there is
55 <     * no such entry.
56 <     *
55 >     * no such entry.
56 >     *
57       * @param key the key.
58       * @return an Entry associated with ceiling of given key, or <tt>null</tt>
59       * if there is no such Entry.
# Line 62 | Line 67 | public interface NavigableMap<K,V> exten
67      /**
68       * Returns least key greater than or equal to the given key, or
69       * <tt>null</tt> if there is no such key.
70 <     *
70 >     *
71       * @param key the key.
72       * @return the ceiling key, or <tt>null</tt>
73       * if there is no such key.
# Line 76 | Line 81 | public interface NavigableMap<K,V> exten
81      /**
82       * Returns a key-value mapping associated with the greatest
83       * key strictly less than the given key, or <tt>null</tt> if there is no
84 <     * such entry.
85 <     *
84 >     * such entry.
85 >     *
86       * @param key the key.
87       * @return an Entry with greatest key less than the given
88       * key, or <tt>null</tt> if there is no such Entry.
# Line 91 | Line 96 | public interface NavigableMap<K,V> exten
96      /**
97       * Returns the greatest key strictly less than the given key, or
98       * <tt>null</tt> if there is no such key.
99 <     *
99 >     *
100       * @param key the key.
101       * @return the greatest key less than the given
102       * key, or <tt>null</tt> if there is no such key.
# Line 106 | Line 111 | public interface NavigableMap<K,V> exten
111       * Returns a key-value mapping associated with the greatest key
112       * less than or equal to the given key, or <tt>null</tt> if there
113       * is no such entry.
114 <     *
114 >     *
115       * @param key the key.
116       * @return an Entry associated with floor of given key, or <tt>null</tt>
117       * if there is no such Entry.
# Line 121 | Line 126 | public interface NavigableMap<K,V> exten
126       * Returns the greatest key
127       * less than or equal to the given key, or <tt>null</tt> if there
128       * is no such key.
129 <     *
129 >     *
130       * @param key the key.
131       * @return the floor of given key, or <tt>null</tt> if there is no
132       * such key.
# Line 136 | Line 141 | public interface NavigableMap<K,V> exten
141       * Returns a key-value mapping associated with the least key
142       * strictly greater than the given key, or <tt>null</tt> if there
143       * is no such entry.
144 <     *
144 >     *
145       * @param key the key.
146       * @return an Entry with least key greater than the given key, or
147       * <tt>null</tt> if there is no such Entry.
# Line 150 | Line 155 | public interface NavigableMap<K,V> exten
155      /**
156       * Returns the least key strictly greater than the given key, or
157       * <tt>null</tt> if there is no such key.
158 <     *
158 >     *
159       * @param key the key.
160       * @return the least key greater than the given key, or
161       * <tt>null</tt> if there is no such key.
# Line 164 | Line 169 | public interface NavigableMap<K,V> exten
169      /**
170       * Returns a key-value mapping associated with the least
171       * key in this map, or <tt>null</tt> if the map is empty.
172 <     *
173 <     * @return an Entry with least key, or <tt>null</tt>
172 >     *
173 >     * @return an Entry with least key, or <tt>null</tt>
174       * if the map is empty.
175       */
176      Map.Entry<K,V> firstEntry();
# Line 173 | Line 178 | public interface NavigableMap<K,V> exten
178      /**
179       * Returns a key-value mapping associated with the greatest
180       * key in this map, or <tt>null</tt> if the map is empty.
181 <     *
181 >     *
182       * @return an Entry with greatest key, or <tt>null</tt>
183       * if the map is empty.
184       */
# Line 182 | Line 187 | public interface NavigableMap<K,V> exten
187      /**
188       * Removes and returns a key-value mapping associated with
189       * the least key in this map, or <tt>null</tt> if the map is empty.
190 <     *
190 >     *
191       * @return the removed first entry of this map, or <tt>null</tt>
192       * if the map is empty.
193       */
# Line 191 | Line 196 | public interface NavigableMap<K,V> exten
196      /**
197       * Removes and returns a key-value mapping associated with
198       * the greatest key in this map, or <tt>null</tt> if the map is empty.
199 <     *
199 >     *
200       * @return the removed last entry of this map, or <tt>null</tt>
201       * if the map is empty.
202       */
# Line 240 | Line 245 | public interface NavigableMap<K,V> exten
245       * <tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned
246       * navigable map is empty.)  The returned navigable map is backed
247       * by this map, so changes in the returned navigable map are
248 <     * reflected in this map, and vice-versa. Note: This
244 <     * method differs from <tt>SortedMap.subMap</tt> only
245 <     * in that the returned map is guaranteed to support the
246 <     * <tt>NavigableMap</tt> interface.
248 >     * reflected in this map, and vice-versa.
249       *
250       * @param fromKey low endpoint (inclusive) of the subMap.
251       * @param toKey high endpoint (exclusive) of the subMap.
# Line 267 | Line 269 | public interface NavigableMap<K,V> exten
269       * Returns a view of the portion of this map whose keys are strictly less
270       * than <tt>toKey</tt>.  The returned navigable map is backed by this map, so
271       * changes in the returned navigable map are reflected in this map, and
272 <     * vice-versa.  
272 >     * vice-versa.
273       * @param toKey high endpoint (exclusive) of the headMap.
274       * @return a view of the portion of this map whose keys are strictly
275       *                less than <tt>toKey</tt>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines