12 |
|
* and recursively so for its navigable sub-maps. |
13 |
|
* |
14 |
|
* <p>This interface is a member of the |
15 |
< |
* <a href="{@docRoot}/../guide/collections/index.html"> |
15 |
> |
* <a href="{@docRoot}/../technotes/guides/collections/index.html"> |
16 |
|
* Java Collections Framework</a>. |
17 |
|
* |
18 |
|
* @author Doug Lea |
47 |
|
ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive); |
48 |
|
|
49 |
|
/** |
50 |
– |
* Returns a view of the portion of this map whose keys range from |
51 |
– |
* {@code fromKey}, inclusive, to {@code toKey}, exclusive. (If |
52 |
– |
* {@code fromKey} and {@code toKey} are equal, the returned map |
53 |
– |
* is empty.) The returned map is backed by this map, so changes |
54 |
– |
* in the returned map are reflected in this map, and vice-versa. |
55 |
– |
* The returned map supports all optional map operations that this |
56 |
– |
* map supports. |
57 |
– |
* |
58 |
– |
* <p>The returned map will throw an {@code IllegalArgumentException} |
59 |
– |
* on an attempt to insert a key outside its range. |
60 |
– |
* |
61 |
– |
* <p>Equivalent to {@code subMap(fromKey, true, toKey, false)}. |
62 |
– |
* |
50 |
|
* @throws ClassCastException {@inheritDoc} |
51 |
|
* @throws NullPointerException {@inheritDoc} |
52 |
|
* @throws IllegalArgumentException {@inheritDoc} |
54 |
|
ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey); |
55 |
|
|
56 |
|
/** |
70 |
– |
* Returns a view of the portion of this map whose keys are |
71 |
– |
* strictly less than {@code toKey}. The returned map is backed |
72 |
– |
* by this map, so changes in the returned map are reflected in |
73 |
– |
* this map, and vice-versa. The returned map supports all |
74 |
– |
* optional map operations that this map supports. |
75 |
– |
* |
76 |
– |
* <p>The returned map will throw an {@code IllegalArgumentException} |
77 |
– |
* on an attempt to insert a key outside its range. |
78 |
– |
* |
79 |
– |
* <p>Equivalent to {@code headMap(toKey, false)}. |
80 |
– |
* |
57 |
|
* @throws ClassCastException {@inheritDoc} |
58 |
|
* @throws NullPointerException {@inheritDoc} |
59 |
|
* @throws IllegalArgumentException {@inheritDoc} |
61 |
|
ConcurrentNavigableMap<K,V> headMap(K toKey); |
62 |
|
|
63 |
|
/** |
88 |
– |
* Returns a view of the portion of this map whose keys are |
89 |
– |
* greater than or equal to {@code fromKey}. The returned map is |
90 |
– |
* backed by this map, so changes in the returned map are |
91 |
– |
* reflected in this map, and vice-versa. The returned map |
92 |
– |
* supports all optional map operations that this map supports. |
93 |
– |
* |
94 |
– |
* <p>The returned map will throw an {@code IllegalArgumentException} |
95 |
– |
* on an attempt to insert a key outside its range. |
96 |
– |
* |
97 |
– |
* <p>Equivalent to {@code tailMap(fromKey, true)}. |
98 |
– |
* |
64 |
|
* @throws ClassCastException {@inheritDoc} |
65 |
|
* @throws NullPointerException {@inheritDoc} |
66 |
|
* @throws IllegalArgumentException {@inheritDoc} |
67 |
|
*/ |
68 |
|
ConcurrentNavigableMap<K,V> tailMap(K fromKey); |
69 |
|
|
70 |
+ |
/** |
71 |
+ |
* Returns a reverse order view of the mappings contained in this map. |
72 |
+ |
* The descending map is backed by this map, so changes to the map are |
73 |
+ |
* reflected in the descending map, and vice-versa. |
74 |
+ |
* |
75 |
+ |
* <p>The returned map has an ordering equivalent to |
76 |
+ |
* <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>. |
77 |
+ |
* The expression {@code m.descendingMap().descendingMap()} returns a |
78 |
+ |
* view of {@code m} essentially equivalent to {@code m}. |
79 |
+ |
* |
80 |
+ |
* @return a reverse order view of this map |
81 |
+ |
*/ |
82 |
|
ConcurrentNavigableMap<K,V> descendingMap(); |
83 |
+ |
|
84 |
+ |
/** |
85 |
+ |
* Returns a {@link NavigableSet} view of the keys contained in this map. |
86 |
+ |
* The set's iterator returns the keys in ascending order. |
87 |
+ |
* The set is backed by the map, so changes to the map are |
88 |
+ |
* reflected in the set, and vice-versa. The set supports element |
89 |
+ |
* removal, which removes the corresponding mapping from the map, |
90 |
+ |
* via the {@code Iterator.remove}, {@code Set.remove}, |
91 |
+ |
* {@code removeAll}, {@code retainAll}, and {@code clear} |
92 |
+ |
* operations. It does not support the {@code add} or {@code addAll} |
93 |
+ |
* operations. |
94 |
+ |
* |
95 |
+ |
* <p>The view's {@code iterator} is a "weakly consistent" iterator |
96 |
+ |
* that will never throw {@link ConcurrentModificationException}, |
97 |
+ |
* and guarantees to traverse elements as they existed upon |
98 |
+ |
* construction of the iterator, and may (but is not guaranteed to) |
99 |
+ |
* reflect any modifications subsequent to construction. |
100 |
+ |
* |
101 |
+ |
* @return a navigable set view of the keys in this map |
102 |
+ |
*/ |
103 |
+ |
public NavigableSet<K> navigableKeySet(); |
104 |
+ |
|
105 |
+ |
/** |
106 |
+ |
* Returns a {@link NavigableSet} view of the keys contained in this map. |
107 |
+ |
* The set's iterator returns the keys in ascending order. |
108 |
+ |
* The set is backed by the map, so changes to the map are |
109 |
+ |
* reflected in the set, and vice-versa. The set supports element |
110 |
+ |
* removal, which removes the corresponding mapping from the map, |
111 |
+ |
* via the {@code Iterator.remove}, {@code Set.remove}, |
112 |
+ |
* {@code removeAll}, {@code retainAll}, and {@code clear} |
113 |
+ |
* operations. It does not support the {@code add} or {@code addAll} |
114 |
+ |
* operations. |
115 |
+ |
* |
116 |
+ |
* <p>The view's {@code iterator} is a "weakly consistent" iterator |
117 |
+ |
* that will never throw {@link ConcurrentModificationException}, |
118 |
+ |
* and guarantees to traverse elements as they existed upon |
119 |
+ |
* construction of the iterator, and may (but is not guaranteed to) |
120 |
+ |
* reflect any modifications subsequent to construction. |
121 |
+ |
* |
122 |
+ |
* <p>This method is equivalent to method {@code navigableKeySet}. |
123 |
+ |
* |
124 |
+ |
* @return a navigable set view of the keys in this map |
125 |
+ |
*/ |
126 |
+ |
NavigableSet<K> keySet(); |
127 |
+ |
|
128 |
+ |
/** |
129 |
+ |
* Returns a reverse order {@link NavigableSet} view of the keys contained in this map. |
130 |
+ |
* The set's iterator returns the keys in descending order. |
131 |
+ |
* The set is backed by the map, so changes to the map are |
132 |
+ |
* reflected in the set, and vice-versa. The set supports element |
133 |
+ |
* removal, which removes the corresponding mapping from the map, |
134 |
+ |
* via the {@code Iterator.remove}, {@code Set.remove}, |
135 |
+ |
* {@code removeAll}, {@code retainAll}, and {@code clear} |
136 |
+ |
* operations. It does not support the {@code add} or {@code addAll} |
137 |
+ |
* operations. |
138 |
+ |
* |
139 |
+ |
* <p>The view's {@code iterator} is a "weakly consistent" iterator |
140 |
+ |
* that will never throw {@link ConcurrentModificationException}, |
141 |
+ |
* and guarantees to traverse elements as they existed upon |
142 |
+ |
* construction of the iterator, and may (but is not guaranteed to) |
143 |
+ |
* reflect any modifications subsequent to construction. |
144 |
+ |
* |
145 |
+ |
* @return a reverse order navigable set view of the keys in this map |
146 |
+ |
*/ |
147 |
+ |
public NavigableSet<K> descendingKeySet(); |
148 |
|
} |