public static class EquivalentConcurrentHashMapV8.KeySetView<K,V> extends EquivalentConcurrentHashMapV8.CollectionView<K,V,K> implements java.util.Set<K>, java.io.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)
.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
private V |
value |
map
Constructor and Description |
---|
EquivalentConcurrentHashMapV8.KeySetView(EquivalentConcurrentHashMapV8<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(java.util.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(java.lang.Object o) |
boolean |
equals(java.lang.Object o) |
void |
forEach(EquivalentConcurrentHashMapV8.Action<? super K> action) |
V |
getMappedValue()
Returns the default mapped value for additions,
or
null if additions are not supported. |
int |
hashCode() |
java.util.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(java.lang.Object o)
Removes the key from this map view, by removing the key (and its
corresponding value) from the backing map.
|
EquivalentConcurrentHashMapV8.ConcurrentHashMapSpliterator<K> |
spliteratorV8() |
clear, containsAll, getMap, isEmpty, removeAll, retainAll, size, toArray, toArray, toString
private static final long serialVersionUID
private final V value
EquivalentConcurrentHashMapV8.KeySetView(EquivalentConcurrentHashMapV8<K,V> map, V value)
public V getMappedValue()
null
if additions are not supported.null
if not supportedpublic boolean contains(java.lang.Object o)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<K>
remove
in interface java.util.Set<K>
remove
in class EquivalentConcurrentHashMapV8.CollectionView<K,V,K>
o
- the key to be removed from the backing maptrue
if the backing map contained the specified keyjava.lang.NullPointerException
- if the specified key is nullpublic java.util.Iterator<K> iterator()
EquivalentConcurrentHashMapV8.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.iterator
in interface java.lang.Iterable<K>
iterator
in interface java.util.Collection<K>
iterator
in interface java.util.Set<K>
iterator
in class EquivalentConcurrentHashMapV8.CollectionView<K,V,K>
public boolean add(K e)
add
in interface java.util.Collection<K>
add
in interface java.util.Set<K>
e
- key to be addedtrue
if this set changed as a result of the calljava.lang.NullPointerException
- if the specified key is nulljava.lang.UnsupportedOperationException
- if no default mapped value
for additions was providedpublic boolean addAll(java.util.Collection<? extends K> c)
add(K)
on each one.addAll
in interface java.util.Collection<K>
addAll
in interface java.util.Set<K>
c
- the elements to be inserted into this settrue
if this set changed as a result of the calljava.lang.NullPointerException
- if the collection or any of its
elements are null
java.lang.UnsupportedOperationException
- if no default mapped value
for additions was providedpublic int hashCode()
public boolean equals(java.lang.Object o)
public EquivalentConcurrentHashMapV8.ConcurrentHashMapSpliterator<K> spliteratorV8()
public void forEach(EquivalentConcurrentHashMapV8.Action<? super K> action)