Class ConcurrentHashMapV8.CollectionView<K,V,E>
java.lang.Object
org.glassfish.jersey.internal.util.collection.ConcurrentHashMapV8.CollectionView<K,V,E>
- All Implemented Interfaces:
Serializable
,Iterable<E>
,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 Object
implements Collection<E>, Serializable
Base class for views.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ConcurrentHashMapV8
<K, V> private static final String
private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
clear()
Removes all of the elements from this view, by removing all the mappings from the map backing this view.abstract boolean
final boolean
containsAll
(Collection<?> c) getMap()
Returns the map backing this view.final boolean
isEmpty()
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
final boolean
removeAll
(Collection<?> c) final boolean
retainAll
(Collection<?> c) final int
size()
final Object[]
toArray()
final <T> T[]
toArray
(T[] a) final 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
Methods inherited from interface java.util.Collection
add, addAll, equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
map
-
oomeMsg
- See Also:
-
-
Constructor Details
-
CollectionView
CollectionView(ConcurrentHashMapV8<K, V> map)
-
-
Method Details
-
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 interfaceCollection<K>
-
size
public final int size()- Specified by:
size
in interfaceCollection<K>
-
isEmpty
public final boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<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. -
contains
- Specified by:
contains
in interfaceCollection<K>
-
remove
- Specified by:
remove
in interfaceCollection<K>
-
toArray
- Specified by:
toArray
in interfaceCollection<K>
-
toArray
public final <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<K>
-
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)
. -
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<K>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<K>
-