Package net.sf.ehcache.util.concurrent
Class ConcurrentHashMap.KeySetView<K,V>
- java.lang.Object
-
- net.sf.ehcache.util.concurrent.ConcurrentHashMap.KeySetView<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<K>,java.util.Collection<K>,java.util.Set<K>
- Enclosing class:
- ConcurrentHashMap<K,V>
public static class ConcurrentHashMap.KeySetView<K,V> extends java.lang.Object implements java.util.Set<K>, java.io.SerializableA view of a ConcurrentHashMap as aSetof keys, in which additions may optionally be enabled by mapping to a common value. This class cannot be directly instantiated. SeeConcurrentHashMap.keySet,ConcurrentHashMap.keySet(Object),ConcurrentHashMap.newKeySet(),ConcurrentHashMap.newKeySet(int).- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(K e)booleanaddAll(java.util.Collection<? extends K> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)ConcurrentHashMap<K,V>getMap()Returns the map backing this view.VgetMappedValue()Returns the default mapped value for additions, ornullif additions are not supported.inthashCode()booleanisEmpty()java.util.Iterator<K>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.booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()
-
-
-
Method Detail
-
getMappedValue
public V 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
public boolean contains(java.lang.Object o)
-
remove
public boolean remove(java.lang.Object o)
-
iterator
public java.util.Iterator<K> 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.
-
add
public boolean add(K e)
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
equals
public boolean equals(java.lang.Object o)
-
getMap
public ConcurrentHashMap<K,V> getMap()
Returns the map backing this view.- Returns:
- the map backing this view
-
size
public final int size()
-
isEmpty
public final boolean isEmpty()
-
clear
public final void clear()
-
toArray
public final java.lang.Object[] toArray()
-
toArray
public final <T> T[] toArray(T[] a)
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
containsAll
public final boolean containsAll(java.util.Collection<?> c)
-
removeAll
public final boolean removeAll(java.util.Collection<?> c)
-
retainAll
public final boolean retainAll(java.util.Collection<?> c)
-
-