Class ConcurrentHashMapV8.KeySetView<K,V>
java.lang.Object
org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.CollectionView<K,V,K>
org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.KeySetView<K,V>
- All Implemented Interfaces:
Serializable, Iterable<K>, Collection<K>, Set<K>
- Enclosing class:
ConcurrentHashMapV8<K,V>
public static class ConcurrentHashMapV8.KeySetView<K,V>
extends ConcurrentHashMapV8.CollectionView<K,V,K>
implements Set<K>, Serializable
A view of a ConcurrentHashMapV8 as a
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).- Since:
- 1.8
- See Also:
-
Field Summary
FieldsFields inherited from class ConcurrentHashMapV8.CollectionView
map -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds the specified key to this set view by mapping the key to the default mapped value in the backing map, if defined.booleanaddAll(Collection<? extends K> c) Adds all of the elements in the specified collection to this set, as if by callingadd(K)on each one.booleanbooleanReturns the default mapped value for additions, ornullif additions are not supported.inthashCode()iterator()Returns a "weakly consistent" iterator that will never throwConcurrentModificationException, 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.booleanRemoves the key from this map view, by removing the key (and its corresponding value) from the backing map.Methods inherited from class ConcurrentHashMapV8.CollectionView
clear, containsAll, getMap, isEmpty, removeAll, retainAll, size, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
clear, containsAll, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
value
-
-
Constructor Details
-
KeySetView
KeySetView(ConcurrentHashMapV8<K, V> map, V value)
-
-
Method Details
-
getMappedValue
Returns the default mapped value for additions, ornullif additions are not supported.- Returns:
- the default mapped value for additions, or
nullif not supported
-
contains
- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Specified by:
containsin classConcurrentHashMapV8.CollectionView<K,V, K> - Throws:
NullPointerException- if the specified key is null
-
remove
Removes the key from this map view, by removing the key (and its corresponding value) from the backing map. This method does nothing if the key is not in the map.- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Specified by:
removein classConcurrentHashMapV8.CollectionView<K,V, K> - Parameters:
o- the key to be removed from the backing map- Returns:
trueif the backing map contained the specified key- Throws:
NullPointerException- if the specified key is null
-
iterator
Description copied from class:ConcurrentHashMapV8.CollectionViewReturns a "weakly consistent" iterator that will never throwConcurrentModificationException, 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. -
add
Adds the specified key to this set view by mapping the key to the default mapped value in the backing map, if defined.- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceSet<K>- Parameters:
e- key to be added- Returns:
trueif this set changed as a result of the call- Throws:
NullPointerException- if the specified key is nullUnsupportedOperationException- if no default mapped value for additions was provided
-
addAll
Adds all of the elements in the specified collection to this set, as if by callingadd(K)on each one.- Specified by:
addAllin interfaceCollection<K>- Specified by:
addAllin interfaceSet<K>- Parameters:
c- the elements to be inserted into this set- Returns:
trueif this set changed as a result of the call- Throws:
NullPointerException- if the collection or any of its elements arenullUnsupportedOperationException- if no default mapped value for additions was provided
-
hashCode
-
equals
-