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>. |
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 |
61 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
62 |
|
* does not support <tt>null</tt> keys. |
63 |
|
*/ |
64 |
< |
public Map.Entry<K,V> ceilingEntry(K key); |
64 |
> |
Map.Entry<K,V> ceilingEntry(K key); |
65 |
|
|
66 |
|
/** |
67 |
|
* Returns least key greater than or equal to the given key, or |
75 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
76 |
|
* does not support <tt>null</tt> keys. |
77 |
|
*/ |
78 |
< |
public K ceilingKey(K key); |
78 |
> |
K ceilingKey(K key); |
79 |
|
|
80 |
|
/** |
81 |
|
* Returns a key-value mapping associated with the greatest |
90 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
91 |
|
* does not support <tt>null</tt> keys. |
92 |
|
*/ |
93 |
< |
public Map.Entry<K,V> lowerEntry(K key); |
93 |
> |
Map.Entry<K,V> lowerEntry(K key); |
94 |
|
|
95 |
|
/** |
96 |
|
* Returns the greatest key strictly less than the given key, or |
104 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
105 |
|
* does not support <tt>null</tt> keys. |
106 |
|
*/ |
107 |
< |
public K lowerKey(K key); |
107 |
> |
K lowerKey(K key); |
108 |
|
|
109 |
|
/** |
110 |
|
* Returns a key-value mapping associated with the greatest key |
119 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
120 |
|
* does not support <tt>null</tt> keys. |
121 |
|
*/ |
122 |
< |
public Map.Entry<K,V> floorEntry(K key); |
122 |
> |
Map.Entry<K,V> floorEntry(K key); |
123 |
|
|
124 |
|
/** |
125 |
|
* Returns the greatest key |
134 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
135 |
|
* does not support <tt>null</tt> keys. |
136 |
|
*/ |
137 |
< |
public K floorKey(K key); |
137 |
> |
K floorKey(K key); |
138 |
|
|
139 |
|
/** |
140 |
|
* Returns a key-value mapping associated with the least key |
149 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
150 |
|
* does not support <tt>null</tt> keys. |
151 |
|
*/ |
152 |
< |
public Map.Entry<K,V> higherEntry(K key); |
152 |
> |
Map.Entry<K,V> higherEntry(K key); |
153 |
|
|
154 |
|
/** |
155 |
|
* Returns the least key strictly greater than the given key, or |
163 |
|
* @throws NullPointerException if key is <tt>null</tt> and this map |
164 |
|
* does not support <tt>null</tt> keys. |
165 |
|
*/ |
166 |
< |
public K higherKey(K key); |
166 |
> |
K higherKey(K key); |
167 |
|
|
168 |
|
/** |
169 |
|
* Returns a key-value mapping associated with the least |
172 |
|
* @return an Entry with least key, or <tt>null</tt> |
173 |
|
* if the map is empty. |
174 |
|
*/ |
175 |
< |
public Map.Entry<K,V> firstEntry(); |
175 |
> |
Map.Entry<K,V> firstEntry(); |
176 |
|
|
177 |
|
/** |
178 |
|
* Returns a key-value mapping associated with the greatest |
181 |
|
* @return an Entry with greatest key, or <tt>null</tt> |
182 |
|
* if the map is empty. |
183 |
|
*/ |
184 |
< |
public Map.Entry<K,V> lastEntry(); |
184 |
> |
Map.Entry<K,V> lastEntry(); |
185 |
|
|
186 |
|
/** |
187 |
|
* Removes and returns a key-value mapping associated with |
190 |
|
* @return the removed first entry of this map, or <tt>null</tt> |
191 |
|
* if the map is empty. |
192 |
|
*/ |
193 |
< |
public Map.Entry<K,V> pollFirstEntry(); |
193 |
> |
Map.Entry<K,V> pollFirstEntry(); |
194 |
|
|
195 |
|
/** |
196 |
|
* Removes and returns a key-value mapping associated with |
199 |
|
* @return the removed last entry of this map, or <tt>null</tt> |
200 |
|
* if the map is empty. |
201 |
|
*/ |
202 |
< |
public Map.Entry<K,V> pollLastEntry(); |
202 |
> |
Map.Entry<K,V> pollLastEntry(); |
203 |
|
|
204 |
|
/** |
205 |
|
* Returns a set view of the keys contained in this map, in |
241 |
|
/** |
242 |
|
* Returns a view of the portion of this map whose keys range from |
243 |
|
* <tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive. (If |
244 |
< |
* <tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned sorted map |
245 |
< |
* is empty.) The returned sorted map is backed by this map, so changes |
246 |
< |
* in the returned sorted map are reflected in this map, and vice-versa. |
247 |
< |
|
244 |
> |
* <tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned |
245 |
> |
* navigable map is empty.) The returned navigable map is backed |
246 |
> |
* by this map, so changes in the returned navigable map are |
247 |
> |
* reflected in this map, and vice-versa. |
248 |
> |
* |
249 |
|
* @param fromKey low endpoint (inclusive) of the subMap. |
250 |
|
* @param toKey high endpoint (exclusive) of the subMap. |
251 |
|
* |
262 |
|
* <tt>toKey</tt> is <tt>null</tt> and this map does not support |
263 |
|
* <tt>null</tt> keys. |
264 |
|
*/ |
265 |
< |
public NavigableMap<K,V> subMap(K fromKey, K toKey); |
265 |
> |
NavigableMap<K,V> navigableSubMap(K fromKey, K toKey); |
266 |
|
|
267 |
|
/** |
268 |
|
* Returns a view of the portion of this map whose keys are strictly less |
269 |
< |
* than <tt>toKey</tt>. The returned sorted map is backed by this map, so |
270 |
< |
* changes in the returned sorted map are reflected in this map, and |
269 |
> |
* than <tt>toKey</tt>. The returned navigable map is backed by this map, so |
270 |
> |
* changes in the returned navigable map are reflected in this map, and |
271 |
|
* vice-versa. |
272 |
|
* @param toKey high endpoint (exclusive) of the headMap. |
273 |
|
* @return a view of the portion of this map whose keys are strictly |
279 |
|
* @throws NullPointerException if <tt>toKey</tt> is <tt>null</tt> |
280 |
|
* and this map does not support <tt>null</tt> keys. |
281 |
|
*/ |
282 |
< |
public NavigableMap<K,V> headMap(K toKey); |
282 |
> |
NavigableMap<K,V> navigableHeadMap(K toKey); |
283 |
|
|
284 |
|
/** |
285 |
|
* Returns a view of the portion of this map whose keys are |
286 |
< |
* greater than or equal to <tt>fromKey</tt>. The returned sorted |
287 |
< |
* map is backed by this map, so changes in the returned sorted |
286 |
> |
* greater than or equal to <tt>fromKey</tt>. The returned navigable |
287 |
> |
* map is backed by this map, so changes in the returned navigable |
288 |
|
* map are reflected in this map, and vice-versa. |
289 |
|
* @param fromKey low endpoint (inclusive) of the tailMap. |
290 |
|
* @return a view of the portion of this map whose keys are greater |
295 |
|
* @throws NullPointerException if <tt>fromKey</tt> is <tt>null</tt> |
296 |
|
* and this map does not support <tt>null</tt> keys. |
297 |
|
*/ |
298 |
< |
public NavigableMap<K,V> tailMap(K fromKey); |
298 |
> |
NavigableMap<K,V> navigableTailMap(K fromKey); |
299 |
|
} |