ConcurrentHashMap.KeySetView

public static class ConcurrentHashMap.KeySetView extends Object
implements Collection<K> Serializable Set<K> Serializable

A view of a ConcurrentHashMap 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(V), newKeySet(), newKeySet(int).

Public Method Summary

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(E) on each one.
final void
clear()
Removes all of the elements from this view, by removing all the mappings from the map backing this view.
boolean
contains(Object o)
Returns true if this collection contains the specified element.
final boolean
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements in the specified collection.
boolean
equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
void
forEach(Consumer<? super K> action)
ConcurrentHashMap<K, V>
getMap()
Returns the map backing this view.
V
getMappedValue()
Returns the default mapped value for additions, or null if additions are not supported.
int
hashCode()
Returns an integer hash code for this object.
final boolean
isEmpty()
Returns true if this collection contains no elements.
Iterator<K>
iterator()
Returns an iterator over the elements in this collection.
boolean
remove(Object o)
Removes the key from this map view, by removing the key (and its corresponding value) from the backing map.
final boolean
removeAll(Collection<?> c)
Removes all of this collection's elements that are also contained in the specified collection (optional operation).
final boolean
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection (optional operation).
final int
size()
Returns the number of elements in this collection.
Spliterator<K>
spliterator()
Creates a Spliterator over the elements in this collection.
final <T> T[]
toArray(T[] a)
Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
final Object[]
toArray()
Returns an array containing all of the elements in this collection.
final String
toString()
Returns a string representation of this collection.

Inherited Method Summary