1 |
dl |
1.1 |
/* |
2 |
|
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
|
* Expert Group and released to the public domain, as explained at |
4 |
|
|
* http://creativecommons.org/licenses/publicdomain |
5 |
|
|
*/ |
6 |
|
|
|
7 |
|
|
package java.util.concurrent; |
8 |
|
|
import java.util.*; |
9 |
|
|
|
10 |
|
|
/** |
11 |
dl |
1.5 |
* A {@link ConcurrentMap} supporting {@link NavigableMap} operations, |
12 |
|
|
* and recursively so for its navigable sub-maps. |
13 |
dl |
1.1 |
* |
14 |
jsr166 |
1.3 |
* <p>This interface is a member of the |
15 |
|
|
* <a href="{@docRoot}/../guide/collections/index.html"> |
16 |
|
|
* Java Collections Framework</a>. |
17 |
|
|
* |
18 |
dl |
1.1 |
* @author Doug Lea |
19 |
|
|
* @param <K> the type of keys maintained by this map |
20 |
jsr166 |
1.3 |
* @param <V> the type of mapped values |
21 |
|
|
* @since 1.6 |
22 |
dl |
1.1 |
*/ |
23 |
jsr166 |
1.3 |
public interface ConcurrentNavigableMap<K,V> |
24 |
|
|
extends ConcurrentMap<K,V>, NavigableMap<K,V> |
25 |
|
|
{ |
26 |
dl |
1.1 |
/** |
27 |
jsr166 |
1.3 |
* @throws ClassCastException {@inheritDoc} |
28 |
jsr166 |
1.4 |
* @throws NullPointerException {@inheritDoc} |
29 |
jsr166 |
1.3 |
* @throws IllegalArgumentException {@inheritDoc} |
30 |
dl |
1.1 |
*/ |
31 |
dl |
1.9 |
ConcurrentNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, |
32 |
|
|
K toKey, boolean toInclusive); |
33 |
dl |
1.1 |
|
34 |
|
|
/** |
35 |
jsr166 |
1.3 |
* @throws ClassCastException {@inheritDoc} |
36 |
jsr166 |
1.4 |
* @throws NullPointerException {@inheritDoc} |
37 |
jsr166 |
1.3 |
* @throws IllegalArgumentException {@inheritDoc} |
38 |
dl |
1.1 |
*/ |
39 |
dl |
1.9 |
ConcurrentNavigableMap<K,V> headMap(K toKey, boolean inclusive); |
40 |
dl |
1.8 |
|
41 |
dl |
1.1 |
|
42 |
|
|
/** |
43 |
jsr166 |
1.3 |
* @throws ClassCastException {@inheritDoc} |
44 |
jsr166 |
1.4 |
* @throws NullPointerException {@inheritDoc} |
45 |
jsr166 |
1.3 |
* @throws IllegalArgumentException {@inheritDoc} |
46 |
dl |
1.1 |
*/ |
47 |
dl |
1.9 |
ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive); |
48 |
dl |
1.5 |
|
49 |
|
|
/** |
50 |
jsr166 |
1.10 |
* 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 |
|
|
* |
63 |
dl |
1.5 |
* @throws ClassCastException {@inheritDoc} |
64 |
|
|
* @throws NullPointerException {@inheritDoc} |
65 |
|
|
* @throws IllegalArgumentException {@inheritDoc} |
66 |
|
|
*/ |
67 |
|
|
ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey); |
68 |
|
|
|
69 |
|
|
/** |
70 |
jsr166 |
1.10 |
* 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 |
|
|
* |
81 |
dl |
1.5 |
* @throws ClassCastException {@inheritDoc} |
82 |
|
|
* @throws NullPointerException {@inheritDoc} |
83 |
|
|
* @throws IllegalArgumentException {@inheritDoc} |
84 |
|
|
*/ |
85 |
|
|
ConcurrentNavigableMap<K,V> headMap(K toKey); |
86 |
|
|
|
87 |
|
|
/** |
88 |
jsr166 |
1.10 |
* 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 |
|
|
* |
99 |
dl |
1.5 |
* @throws ClassCastException {@inheritDoc} |
100 |
|
|
* @throws NullPointerException {@inheritDoc} |
101 |
|
|
* @throws IllegalArgumentException {@inheritDoc} |
102 |
|
|
*/ |
103 |
|
|
ConcurrentNavigableMap<K,V> tailMap(K fromKey); |
104 |
|
|
|
105 |
dl |
1.8 |
ConcurrentNavigableMap<K,V> descendingMap(); |
106 |
dl |
1.1 |
} |