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 |
> |
* @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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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(); |
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 |
|
*/ |
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 |
|
*/ |
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 |
|
*/ |
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. |
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. |
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>. |