public static class ConcurrentHashMapV8.KeySetView<K,V> extends ConcurrentHashMapV8.CollectionView<K,V,K> implements Set<K>, Serializable
Set
of keys, in
which additions may optionally be enabled by mapping to a
common value. This class cannot be directly instantiated.
See keySet()
,
keySet(V)
,
newKeySet()
,
newKeySet(int)
.map
Constructor and Description |
---|
KeySetView(ConcurrentHashMapV8<K,V> map,
V value) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(K e)
Adds the specified key to this set view by mapping the key to
the default mapped value in the backing map, if defined.
|
boolean |
addAll(Collection<? extends K> c)
Adds all of the elements in the specified collection to this set,
as if by calling
add(K) on each one. |
boolean |
contains(Object o) |
boolean |
equals(Object o) |
void |
forEach(ConcurrentHashMapV8.Action<? super K> action) |
V |
getMappedValue()
Returns the default mapped value for additions,
or
null if additions are not supported. |
int |
hashCode() |
Iterator<K> |
iterator()
Returns a "weakly consistent" iterator that will never
throw
ConcurrentModificationException , and
guarantees to traverse elements as they existed upon
construction of the iterator, and may (but is not
guaranteed to) reflect any modifications subsequent to
construction. |
boolean |
remove(Object o)
Removes the key from this map view, by removing the key (and its
corresponding value) from the backing map.
|
clear, containsAll, getMap, isEmpty, removeAll, retainAll, size, toArray, toArray, toString
KeySetView(ConcurrentHashMapV8<K,V> map, V value)
public V getMappedValue()
null
if additions are not supported.null
if not supportedpublic boolean contains(Object o)
public boolean remove(Object o)
remove
in interface Collection<K>
remove
in interface Set<K>
remove
in class ConcurrentHashMapV8.CollectionView<K,V,K>
o
- the key to be removed from the backing maptrue
if the backing map contained the specified keyNullPointerException
- if the specified key is nullpublic Iterator<K> iterator()
ConcurrentHashMapV8.CollectionView
ConcurrentModificationException
, and
guarantees to traverse elements as they existed upon
construction of the iterator, and may (but is not
guaranteed to) reflect any modifications subsequent to
construction.public boolean add(K e)
add
in interface Collection<K>
add
in interface Set<K>
e
- key to be addedtrue
if this set changed as a result of the callNullPointerException
- if the specified key is nullUnsupportedOperationException
- if no default mapped value
for additions was providedpublic boolean addAll(Collection<? extends K> c)
add(K)
on each one.addAll
in interface Collection<K>
addAll
in interface Set<K>
c
- the elements to be inserted into this settrue
if this set changed as a result of the callNullPointerException
- if the collection or any of its
elements are null
UnsupportedOperationException
- if no default mapped value
for additions was providedpublic int hashCode()
public boolean equals(Object o)
public void forEach(ConcurrentHashMapV8.Action<? super K> action)
Copyright © 2010-2020 Toolsverse. All Rights Reserved.