public interface ConcurrentNavigableMap
implements ConcurrentMap<K, V>, NavigableMap<K, V>
| java.util.concurrent.ConcurrentNavigableMap<K, V> |
|
ConcurrentSkipListMap<K, V>
|
一个 ConcurrentMap支持 NavigableMap操作,并递归地为其导航子地图。
公共方法(Public methods) |
|
|---|---|
abstract NavigableSet<K> |
descendingKeySet() 返回包含在此映射中的键的相反顺序 |
abstract ConcurrentNavigableMap<K, V> |
descendingMap() 返回此映射中包含的映射的逆序视图。 |
abstract ConcurrentNavigableMap<K, V> |
headMap(K toKey) 返回此映射的关键字严格小于 相当于 |
abstract ConcurrentNavigableMap<K, V> |
headMap(K toKey, boolean inclusive) 返回此映射关键字小于(或等于,如果 |
abstract NavigableSet<K> |
keySet() 返回此映射中包含的键的 |
abstract NavigableSet<K> |
navigableKeySet() 返回此映射中包含的键的 |
abstract ConcurrentNavigableMap<K, V> |
subMap(K fromKey, K toKey) 返回此映射的部分视图,其键的范围从 相当于 |
abstract ConcurrentNavigableMap<K, V> |
subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) 返回此映射部分的视图,其键的范围从 |
abstract ConcurrentNavigableMap<K, V> |
tailMap(K fromKey, boolean inclusive) 返回此映射关键字大于(或等于,如果 |
abstract ConcurrentNavigableMap<K, V> |
tailMap(K fromKey) 返回此映射的关键字大于或等于 相当于 |
继承方法(Inherited methods) |
|
|---|---|
java.util.concurrent.ConcurrentMap
|
|
java.util.NavigableMap
|
|
java.util.Map
|
|
java.util.SortedMap
|
|
NavigableSet<K> descendingKeySet ()
返回此映射中包含的键的逆序NavigableSet视图。 集合的迭代器按降序返回键。 该集合由地图支持,因此对地图的更改反映在集合中,反之亦然。 该组支持元件移除,即从映射中相应的映射,经由Iterator.remove , Set.remove , removeAll , retainAll ,和clear操作。 它不支持add或addAll操作。
视图的迭代器和分割器是 weakly consistent 。
| 返回(Returns) | |
|---|---|
NavigableSet<K> |
a reverse order navigable set view of the keys in this map |
ConcurrentNavigableMap<K, V> descendingMap ()
返回此映射中包含的映射的逆序视图。 降序地图由此地图支持,因此对地图的更改反映在降序地图中,反之亦然。
返回的地图的订购等同于Collections.reverseOrder (comparator()) 。 表达m.descendingMap().descendingMap()返回一个视图的m实质上等同于m 。
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a reverse order view of this map |
ConcurrentNavigableMap<K, V> headMap (K toKey)
返回此映射的关键字严格小于toKey的部分的视图。 返回的地图由此地图支持,因此返回地图中的更改会反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
尝试在其范围外插入密钥时,返回的地图会抛出 IllegalArgumentException 。
相当于 headMap(toKey, false) 。
| 参数(Parameters) | |
|---|---|
toKey |
K: high endpoint (exclusive) of the keys in the returned map |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys are strictly less than toKey |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|
ConcurrentNavigableMap<K, V> headMap (K toKey, boolean inclusive)
返回此映射的键部分小于(或等于,如果inclusive为true)的部分的toKey 。 返回的地图由此地图支持,因此返回地图中的更改会反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
尝试在其范围外插入密钥时,返回的地图会抛出 IllegalArgumentException 。
| 参数(Parameters) | |
|---|---|
toKey |
K: high endpoint of the keys in the returned map |
inclusive |
boolean: true if the high endpoint is to be included in the returned view |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys are less than (or equal to, if inclusive is true) toKey |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|
NavigableSet<K> keySet ()
返回此映射中包含的键的NavigableSet视图。 集合的迭代器按照升序返回键。 该集合由地图支持,因此对地图的更改反映在集合中,反之亦然。 该组支持元件移除,即从映射中相应的映射,经由Iterator.remove , Set.remove , removeAll , retainAll ,和clear操作。 它不支持add或addAll操作。
视图的迭代器和分割器是 weakly consistent 。
该方法相当于方法 navigableKeySet 。
| 返回(Returns) | |
|---|---|
NavigableSet<K> |
a navigable set view of the keys in this map |
NavigableSet<K> navigableKeySet ()
返回此映射中包含的键的NavigableSet视图。 集合的迭代器按照升序返回键。 该集合由地图支持,因此对地图的更改反映在集合中,反之亦然。 该组支持元件移除,即从映射中相应的映射,经由Iterator.remove , Set.remove , removeAll , retainAll ,和clear操作。 它不支持add或addAll操作。
视图的迭代器和分割器是 weakly consistent 。
| 返回(Returns) | |
|---|---|
NavigableSet<K> |
a navigable set view of the keys in this map |
ConcurrentNavigableMap<K, V> subMap (K fromKey, K toKey)
返回此映射部分的视图,其键的范围从fromKey (含),至toKey (独占)。 (如果fromKey和toKey相等,则返回的地图是空的。)返回的地图由此地图支持,因此返回的地图中的更改将反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
尝试在其范围外插入密钥时,返回的地图会抛出 IllegalArgumentException 。
相当于 subMap(fromKey, true, toKey, false) 。
| 参数(Parameters) | |
|---|---|
fromKey |
K: low endpoint (inclusive) of the keys in the returned map |
toKey |
K: high endpoint (exclusive) of the keys in the returned map |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|
ConcurrentNavigableMap<K, V> subMap (K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
返回此映射部分的视图,其键的范围从fromKey到toKey 。 如果fromKey和toKey相等,则返回的映射为空,除非fromInclusive和toInclusive均为真。 返回的地图由此地图支持,因此返回地图中的更改会反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
返回的映射将尝试在其范围之外插入一个键,或者构造其端点位于其范围之外的子映射的 IllegalArgumentException 。
| 参数(Parameters) | |
|---|---|
fromKey |
K: low endpoint of the keys in the returned map |
fromInclusive |
boolean: true if the low endpoint is to be included in the returned view |
toKey |
K: high endpoint of the keys in the returned map |
toInclusive |
boolean: true if the high endpoint is to be included in the returned view |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys range from fromKey to toKey |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|
ConcurrentNavigableMap<K, V> tailMap (K fromKey, boolean inclusive)
返回此映射关键字大于(或等于,如果inclusive为true)的部分fromKey 。 返回的地图由此地图支持,因此返回地图中的更改会反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
返回的地图将尝试在其范围外插入密钥时尝试投射 IllegalArgumentException 。
| 参数(Parameters) | |
|---|---|
fromKey |
K: low endpoint of the keys in the returned map |
inclusive |
boolean: true if the low endpoint is to be included in the returned view |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys are greater than (or equal to, if inclusive is true) fromKey |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|
ConcurrentNavigableMap<K, V> tailMap (K fromKey)
返回此映射的关键字大于或等于fromKey的部分的视图。 返回的地图由此地图支持,因此返回地图中的更改会反映在此地图中,反之亦然。 返回的地图支持该地图支持的所有可选地图操作。
试图在其范围外插入密钥时,返回的地图会抛出 IllegalArgumentException 。
相当于 tailMap(fromKey, true) 。
| 参数(Parameters) | |
|---|---|
fromKey |
K: low endpoint (inclusive) of the keys in the returned map |
| 返回(Returns) | |
|---|---|
ConcurrentNavigableMap<K, V> |
a view of the portion of this map whose keys are greater than or equal to fromKey |
| 抛出异常(Throws) | |
|---|---|
ClassCastException |
|
NullPointerException |
|
IllegalArgumentException |
|