Class ConcurrentHashMapV8.CollectionView<K,V,E>
- java.lang.Object
-
- org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.CollectionView<K,V,E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
- Direct Known Subclasses:
ConcurrentHashMapV8.EntrySetView
,ConcurrentHashMapV8.KeySetView
,ConcurrentHashMapV8.ValuesView
- Enclosing class:
- ConcurrentHashMapV8<K,V>
abstract static class ConcurrentHashMapV8.CollectionView<K,V,E> extends java.lang.Object implements java.util.Collection<E>, java.io.Serializable
Base class for views.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ConcurrentHashMapV8<K,V>
map
private static java.lang.String
oomeMsg
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description CollectionView(ConcurrentHashMapV8<K,V> map)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all of the elements from this view, by removing all the mappings from the map backing this view.abstract boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
ConcurrentHashMapV8<K,V>
getMap()
Returns the map backing this view.boolean
isEmpty()
abstract java.util.Iterator<E>
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.abstract boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
java.lang.String
toString()
Returns a string representation of this collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
map
final ConcurrentHashMapV8<K,V> map
-
oomeMsg
private static final java.lang.String oomeMsg
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CollectionView
CollectionView(ConcurrentHashMapV8<K,V> map)
-
-
Method Detail
-
getMap
public ConcurrentHashMapV8<K,V> getMap()
Returns the map backing this view.- Returns:
- the map backing this view
-
clear
public final void clear()
Removes all of the elements from this view, by removing all the mappings from the map backing this view.- Specified by:
clear
in interfacejava.util.Collection<K>
-
size
public final int size()
- Specified by:
size
in interfacejava.util.Collection<K>
-
isEmpty
public final boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection<K>
-
iterator
public abstract java.util.Iterator<E> 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.
-
contains
public abstract boolean contains(java.lang.Object o)
- Specified by:
contains
in interfacejava.util.Collection<K>
-
remove
public abstract boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<K>
-
toArray
public final java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection<K>
-
toArray
public final <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfacejava.util.Collection<K>
-
toString
public final java.lang.String toString()
Returns a string representation of this collection. The string representation consists of the string representations of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"
). Adjacent elements are separated by the characters", "
(comma and space). Elements are converted to strings as byString.valueOf(Object)
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this collection
-
containsAll
public final boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<K>
-
removeAll
public final boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<K>
-
retainAll
public final boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<K>
-
-