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 |
< |
* |
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 |
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 |
|
*/ |
50 |
|
public interface NavigableMap<K,V> extends SortedMap<K,V> { |
51 |
|
/** |
52 |
|
* Returns a key-value mapping associated with the least key |
53 |
|
* greater than or equal to the given key, or <tt>null</tt> if there is |
54 |
< |
* no such entry. |
55 |
< |
* |
54 |
> |
* no such entry. |
55 |
> |
* |
56 |
|
* @param key the key. |
57 |
|
* @return an Entry associated with ceiling of given key, or <tt>null</tt> |
58 |
|
* if there is no such Entry. |
66 |
|
/** |
67 |
|
* Returns least key greater than or equal to the given key, or |
68 |
|
* <tt>null</tt> if there is no such key. |
69 |
< |
* |
69 |
> |
* |
70 |
|
* @param key the key. |
71 |
|
* @return the ceiling key, or <tt>null</tt> |
72 |
|
* if there is no such key. |
80 |
|
/** |
81 |
|
* Returns a key-value mapping associated with the greatest |
82 |
|
* key strictly less than the given key, or <tt>null</tt> if there is no |
83 |
< |
* such entry. |
84 |
< |
* |
83 |
> |
* such entry. |
84 |
> |
* |
85 |
|
* @param key the key. |
86 |
|
* @return an Entry with greatest key less than the given |
87 |
|
* key, or <tt>null</tt> if there is no such Entry. |
95 |
|
/** |
96 |
|
* Returns the greatest key strictly less than the given key, or |
97 |
|
* <tt>null</tt> if there is no such key. |
98 |
< |
* |
98 |
> |
* |
99 |
|
* @param key the key. |
100 |
|
* @return the greatest key less than the given |
101 |
|
* key, or <tt>null</tt> if there is no such key. |
110 |
|
* Returns a key-value mapping associated with the greatest key |
111 |
|
* less than or equal to the given key, or <tt>null</tt> if there |
112 |
|
* is no such entry. |
113 |
< |
* |
113 |
> |
* |
114 |
|
* @param key the key. |
115 |
|
* @return an Entry associated with floor of given key, or <tt>null</tt> |
116 |
|
* if there is no such Entry. |
125 |
|
* Returns the greatest key |
126 |
|
* less than or equal to the given key, or <tt>null</tt> if there |
127 |
|
* is no such key. |
128 |
< |
* |
128 |
> |
* |
129 |
|
* @param key the key. |
130 |
|
* @return the floor of given key, or <tt>null</tt> if there is no |
131 |
|
* such key. |
140 |
|
* Returns a key-value mapping associated with the least key |
141 |
|
* strictly greater than the given key, or <tt>null</tt> if there |
142 |
|
* is no such entry. |
143 |
< |
* |
143 |
> |
* |
144 |
|
* @param key the key. |
145 |
|
* @return an Entry with least key greater than the given key, or |
146 |
|
* <tt>null</tt> if there is no such Entry. |
154 |
|
/** |
155 |
|
* Returns the least key strictly greater than the given key, or |
156 |
|
* <tt>null</tt> if there is no such key. |
157 |
< |
* |
157 |
> |
* |
158 |
|
* @param key the key. |
159 |
|
* @return the least key greater than the given key, or |
160 |
|
* <tt>null</tt> if there is no such key. |
168 |
|
/** |
169 |
|
* Returns a key-value mapping associated with the least |
170 |
|
* key in this map, or <tt>null</tt> if the map is empty. |
171 |
< |
* |
172 |
< |
* @return an Entry with least key, or <tt>null</tt> |
171 |
> |
* |
172 |
> |
* @return an Entry with least key, or <tt>null</tt> |
173 |
|
* if the map is empty. |
174 |
|
*/ |
175 |
|
Map.Entry<K,V> firstEntry(); |
177 |
|
/** |
178 |
|
* Returns a key-value mapping associated with the greatest |
179 |
|
* key in this map, or <tt>null</tt> if the map is empty. |
180 |
< |
* |
180 |
> |
* |
181 |
|
* @return an Entry with greatest key, or <tt>null</tt> |
182 |
|
* if the map is empty. |
183 |
|
*/ |
186 |
|
/** |
187 |
|
* Removes and returns a key-value mapping associated with |
188 |
|
* the least key in this map, or <tt>null</tt> if the map is empty. |
189 |
< |
* |
189 |
> |
* |
190 |
|
* @return the removed first entry of this map, or <tt>null</tt> |
191 |
|
* if the map is empty. |
192 |
|
*/ |
195 |
|
/** |
196 |
|
* Removes and returns a key-value mapping associated with |
197 |
|
* the greatest key in this map, or <tt>null</tt> if the map is empty. |
198 |
< |
* |
198 |
> |
* |
199 |
|
* @return the removed last entry of this map, or <tt>null</tt> |
200 |
|
* if the map is empty. |
201 |
|
*/ |
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. |
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. |
268 |
|
* Returns a view of the portion of this map whose keys are strictly less |
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. |
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 |
274 |
|
* less than <tt>toKey</tt>. |