ehcache

net.sf.ehcache.util.concurrent
Class ConcurrentHashMap.KeySetView<K,V>

java.lang.Object
  extended by net.sf.ehcache.util.concurrent.ConcurrentHashMap.KeySetView<K,V>
All Implemented Interfaces:
Serializable, Iterable<K>, Collection<K>, Set<K>
Enclosing class:
ConcurrentHashMap<K,V>

public static class ConcurrentHashMap.KeySetView<K,V>
extends Object
implements 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 ConcurrentHashMap.keySet, ConcurrentHashMap.keySet(Object), ConcurrentHashMap.newKeySet(), ConcurrentHashMap.newKeySet(int).

See Also:
Serialized Form

Method Summary
 boolean add(K e)
           
 boolean addAll(Collection<? extends K> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 boolean equals(Object o)
           
 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()
           
 boolean isEmpty()
           
 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)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
clear, containsAll, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

getMappedValue

public V getMappedValue()
Returns the default mapped value for additions, or null if additions are not supported.

Returns:
the default mapped value for additions, or null if not supported.

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<K>
Specified by:
contains in interface Set<K>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<K>
Specified by:
remove in interface Set<K>

iterator

public 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.

Specified by:
iterator in interface Iterable<K>
Specified by:
iterator in interface Collection<K>
Specified by:
iterator in interface Set<K>
Returns:
an iterator over the keys of this map

add

public boolean add(K e)
Specified by:
add in interface Collection<K>
Specified by:
add in interface Set<K>

addAll

public boolean addAll(Collection<? extends K> c)
Specified by:
addAll in interface Collection<K>
Specified by:
addAll in interface Set<K>

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<K>
Specified by:
equals in interface Set<K>
Overrides:
equals in class Object

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 Object[] toArray()

toArray

public final <T> T[] toArray(T[] a)

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

toString

public final String toString()
Overrides:
toString in class Object

containsAll

public final boolean containsAll(Collection<?> c)

removeAll

public final boolean removeAll(Collection<?> c)

retainAll

public final boolean retainAll(Collection<?> c)

ehcache

Copyright 2001-2014, Terracotta, Inc.