ehcache

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

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

public static final class ConcurrentHashMap.ValuesView<K,V>
extends Object
implements Collection<V>

A view of a ConcurrentHashMap as a Collection of values, in which additions are disabled. This class cannot be directly instantiated. See ConcurrentHashMap.values,

The view's iterator is 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.


Method Summary
 boolean add(V e)
           
 boolean addAll(Collection<? extends V> c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 ConcurrentHashMap<K,V> getMap()
          Returns the map backing this view.
 int hashCode()
           
 boolean isEmpty()
           
 Iterator<V> 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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

contains

public final boolean contains(Object o)
Specified by:
contains in interface Collection<V>

remove

public final boolean remove(Object o)
Specified by:
remove in interface Collection<V>

iterator

public final Iterator<V> 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<V>
Specified by:
iterator in interface Collection<V>
Returns:
an iterator over the values of this map

add

public final boolean add(V e)
Specified by:
add in interface Collection<V>

addAll

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

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-2016, Terracotta, Inc.