ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentNavigableMap.java
Revision: 1.16
Committed: Thu Aug 8 20:12:10 2013 UTC (10 years, 10 months ago) by jsr166
Branch: MAIN
Changes since 1.15: +6 -15 lines
Log Message:
refactor definitions of "weakly consistent" into package-info.java

File Contents

# Content
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/publicdomain/zero/1.0/
5 */
6
7 package java.util.concurrent;
8 import java.util.*;
9
10 /**
11 * A {@link ConcurrentMap} supporting {@link NavigableMap} operations,
12 * and recursively so for its navigable sub-maps.
13 *
14 * <p>This interface is a member of the
15 * <a href="{@docRoot}/../technotes/guides/collections/index.html">
16 * Java Collections Framework</a>.
17 *
18 * @author Doug Lea
19 * @param <K> the type of keys maintained by this map
20 * @param <V> the type of mapped values
21 * @since 1.6
22 */
23 public interface ConcurrentNavigableMap<K,V>
24 extends ConcurrentMap<K,V>, NavigableMap<K,V>
25 {
26 /**
27 * @throws ClassCastException {@inheritDoc}
28 * @throws NullPointerException {@inheritDoc}
29 * @throws IllegalArgumentException {@inheritDoc}
30 */
31 ConcurrentNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive,
32 K toKey, boolean toInclusive);
33
34 /**
35 * @throws ClassCastException {@inheritDoc}
36 * @throws NullPointerException {@inheritDoc}
37 * @throws IllegalArgumentException {@inheritDoc}
38 */
39 ConcurrentNavigableMap<K,V> headMap(K toKey, boolean inclusive);
40
41 /**
42 * @throws ClassCastException {@inheritDoc}
43 * @throws NullPointerException {@inheritDoc}
44 * @throws IllegalArgumentException {@inheritDoc}
45 */
46 ConcurrentNavigableMap<K,V> tailMap(K fromKey, boolean inclusive);
47
48 /**
49 * @throws ClassCastException {@inheritDoc}
50 * @throws NullPointerException {@inheritDoc}
51 * @throws IllegalArgumentException {@inheritDoc}
52 */
53 ConcurrentNavigableMap<K,V> subMap(K fromKey, K toKey);
54
55 /**
56 * @throws ClassCastException {@inheritDoc}
57 * @throws NullPointerException {@inheritDoc}
58 * @throws IllegalArgumentException {@inheritDoc}
59 */
60 ConcurrentNavigableMap<K,V> headMap(K toKey);
61
62 /**
63 * @throws ClassCastException {@inheritDoc}
64 * @throws NullPointerException {@inheritDoc}
65 * @throws IllegalArgumentException {@inheritDoc}
66 */
67 ConcurrentNavigableMap<K,V> tailMap(K fromKey);
68
69 /**
70 * Returns a reverse order view of the mappings contained in this map.
71 * The descending map is backed by this map, so changes to the map are
72 * reflected in the descending map, and vice-versa.
73 *
74 * <p>The returned map has an ordering equivalent to
75 * {@link Collections#reverseOrder(Comparator) Collections.reverseOrder}{@code (comparator())}.
76 * The expression {@code m.descendingMap().descendingMap()} returns a
77 * view of {@code m} essentially equivalent to {@code m}.
78 *
79 * @return a reverse order view of this map
80 */
81 ConcurrentNavigableMap<K,V> descendingMap();
82
83 /**
84 * Returns a {@link NavigableSet} view of the keys contained in this map.
85 * The set's iterator returns the keys in ascending order.
86 * The set is backed by the map, so changes to the map are
87 * reflected in the set, and vice-versa. The set supports element
88 * removal, which removes the corresponding mapping from the map,
89 * via the {@code Iterator.remove}, {@code Set.remove},
90 * {@code removeAll}, {@code retainAll}, and {@code clear}
91 * operations. It does not support the {@code add} or {@code addAll}
92 * operations.
93 *
94 * <p>The view's iterators and spliterators are
95 * <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>.
96 *
97 * @return a navigable set view of the keys in this map
98 */
99 public NavigableSet<K> navigableKeySet();
100
101 /**
102 * Returns a {@link NavigableSet} view of the keys contained in this map.
103 * The set's iterator returns the keys in ascending order.
104 * The set is backed by the map, so changes to the map are
105 * reflected in the set, and vice-versa. The set supports element
106 * removal, which removes the corresponding mapping from the map,
107 * via the {@code Iterator.remove}, {@code Set.remove},
108 * {@code removeAll}, {@code retainAll}, and {@code clear}
109 * operations. It does not support the {@code add} or {@code addAll}
110 * operations.
111 *
112 * <p>The view's iterators and spliterators are
113 * <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>.
114 *
115 * <p>This method is equivalent to method {@code navigableKeySet}.
116 *
117 * @return a navigable set view of the keys in this map
118 */
119 NavigableSet<K> keySet();
120
121 /**
122 * Returns a reverse order {@link NavigableSet} view of the keys contained in this map.
123 * The set's iterator returns the keys in descending order.
124 * The set is backed by the map, so changes to the map are
125 * reflected in the set, and vice-versa. The set supports element
126 * removal, which removes the corresponding mapping from the map,
127 * via the {@code Iterator.remove}, {@code Set.remove},
128 * {@code removeAll}, {@code retainAll}, and {@code clear}
129 * operations. It does not support the {@code add} or {@code addAll}
130 * operations.
131 *
132 * <p>The view's iterators and spliterators are
133 * <a href="package-summary.html#Weakly"><i>weakly consistent</i></a>.
134 *
135 * @return a reverse order navigable set view of the keys in this map
136 */
137 public NavigableSet<K> descendingKeySet();
138 }