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.7 by jsr166, Tue May 3 02:52:07 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 39 | Line 43 | package java.util;
43   * that it is possible to change mappings in the associated map using
44   * method <tt>put</tt>.
45   *
46 + * <p>This interface is a member of the
47 + * <a href="{@docRoot}/../guide/collections/index.html">
48 + * Java Collections Framework</a>.
49 + *
50   * @author Doug Lea
51   * @param <K> the type of keys maintained by this map
52 < * @param <V> the type of mapped values
52 > * @param <V> the type of mapped values
53 > * @since 1.6
54   */
55   public interface NavigableMap<K,V> extends SortedMap<K,V> {
56      /**
57       * Returns a key-value mapping associated with the least key
58       * greater than or equal to the given key, or <tt>null</tt> if there is
59 <     * no such entry.
60 <     *
59 >     * no such entry.
60 >     *
61       * @param key the key.
62       * @return an Entry associated with ceiling of given key, or <tt>null</tt>
63       * if there is no such Entry.
# Line 62 | Line 71 | public interface NavigableMap<K,V> exten
71      /**
72       * Returns least key greater than or equal to the given key, or
73       * <tt>null</tt> if there is no such key.
74 <     *
74 >     *
75       * @param key the key.
76       * @return the ceiling key, or <tt>null</tt>
77       * if there is no such key.
# Line 76 | Line 85 | public interface NavigableMap<K,V> exten
85      /**
86       * Returns a key-value mapping associated with the greatest
87       * key strictly less than the given key, or <tt>null</tt> if there is no
88 <     * such entry.
89 <     *
88 >     * such entry.
89 >     *
90       * @param key the key.
91       * @return an Entry with greatest key less than the given
92       * key, or <tt>null</tt> if there is no such Entry.
# Line 91 | Line 100 | public interface NavigableMap<K,V> exten
100      /**
101       * Returns the greatest key strictly less than the given key, or
102       * <tt>null</tt> if there is no such key.
103 <     *
103 >     *
104       * @param key the key.
105       * @return the greatest key less than the given
106       * key, or <tt>null</tt> if there is no such key.
# Line 106 | Line 115 | public interface NavigableMap<K,V> exten
115       * Returns a key-value mapping associated with the greatest key
116       * less than or equal to the given key, or <tt>null</tt> if there
117       * is no such entry.
118 <     *
118 >     *
119       * @param key the key.
120       * @return an Entry associated with floor of given key, or <tt>null</tt>
121       * if there is no such Entry.
# Line 121 | Line 130 | public interface NavigableMap<K,V> exten
130       * Returns the greatest key
131       * less than or equal to the given key, or <tt>null</tt> if there
132       * is no such key.
133 <     *
133 >     *
134       * @param key the key.
135       * @return the floor of given key, or <tt>null</tt> if there is no
136       * such key.
# Line 136 | Line 145 | public interface NavigableMap<K,V> exten
145       * Returns a key-value mapping associated with the least key
146       * strictly greater than the given key, or <tt>null</tt> if there
147       * is no such entry.
148 <     *
148 >     *
149       * @param key the key.
150       * @return an Entry with least key greater than the given key, or
151       * <tt>null</tt> if there is no such Entry.
# Line 150 | Line 159 | public interface NavigableMap<K,V> exten
159      /**
160       * Returns the least key strictly greater than the given key, or
161       * <tt>null</tt> if there is no such key.
162 <     *
162 >     *
163       * @param key the key.
164       * @return the least key greater than the given key, or
165       * <tt>null</tt> if there is no such key.
# Line 164 | Line 173 | public interface NavigableMap<K,V> exten
173      /**
174       * Returns a key-value mapping associated with the least
175       * key in this map, or <tt>null</tt> if the map is empty.
176 <     *
177 <     * @return an Entry with least key, or <tt>null</tt>
176 >     *
177 >     * @return an Entry with least key, or <tt>null</tt>
178       * if the map is empty.
179       */
180      Map.Entry<K,V> firstEntry();
# Line 173 | Line 182 | public interface NavigableMap<K,V> exten
182      /**
183       * Returns a key-value mapping associated with the greatest
184       * key in this map, or <tt>null</tt> if the map is empty.
185 <     *
185 >     *
186       * @return an Entry with greatest key, or <tt>null</tt>
187       * if the map is empty.
188       */
# Line 182 | Line 191 | public interface NavigableMap<K,V> exten
191      /**
192       * Removes and returns a key-value mapping associated with
193       * the least key in this map, or <tt>null</tt> if the map is empty.
194 <     *
194 >     *
195       * @return the removed first entry of this map, or <tt>null</tt>
196       * if the map is empty.
197       */
# Line 191 | Line 200 | public interface NavigableMap<K,V> exten
200      /**
201       * Removes and returns a key-value mapping associated with
202       * the greatest key in this map, or <tt>null</tt> if the map is empty.
203 <     *
203 >     *
204       * @return the removed last entry of this map, or <tt>null</tt>
205       * if the map is empty.
206       */
# Line 240 | Line 249 | public interface NavigableMap<K,V> exten
249       * <tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned
250       * navigable map is empty.)  The returned navigable map is backed
251       * by this map, so changes in the returned navigable map are
252 <     * 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.
252 >     * reflected in this map, and vice-versa.
253       *
254       * @param fromKey low endpoint (inclusive) of the subMap.
255       * @param toKey high endpoint (exclusive) of the subMap.
# Line 267 | Line 273 | public interface NavigableMap<K,V> exten
273       * Returns a view of the portion of this map whose keys are strictly less
274       * than <tt>toKey</tt>.  The returned navigable map is backed by this map, so
275       * changes in the returned navigable map are reflected in this map, and
276 <     * vice-versa.  
276 >     * vice-versa.
277       * @param toKey high endpoint (exclusive) of the headMap.
278       * @return a view of the portion of this map whose keys are strictly
279       *                less than <tt>toKey</tt>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines