Class ConcurrentReferenceHashSet<E>
- java.lang.Object
-
- org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashSet<E>
-
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Set<E>
public class ConcurrentReferenceHashSet<E> extends Object implements Set<E>, Serializable
A concurrent set whose values may be stored as weak or soft references. If the constructor is invoked withrefType
set to#HARD
, this uses a JDK1.5ConcurrentHashMap
under the covers. Otherwise, it uses aConcurrentReferenceHashMap
.- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConcurrentReferenceHashSet(AbstractReferenceMap.ReferenceStrength refType)
Construct a set with the given reference type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E obj)
boolean
addAll(Collection<? extends E> coll)
void
clear()
boolean
contains(Object obj)
boolean
containsAll(Collection<?> coll)
boolean
equals(Object obj)
int
hashCode()
boolean
isEmpty()
Iterator<E>
iterator()
boolean
remove(Object obj)
boolean
removeAll(Collection<?> coll)
boolean
retainAll(Collection<?> coll)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] arr)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Constructor Detail
-
ConcurrentReferenceHashSet
public ConcurrentReferenceHashSet(AbstractReferenceMap.ReferenceStrength refType)
Construct a set with the given reference type.
-
-
Method Detail
-
add
public boolean add(E obj)
-
addAll
public boolean addAll(Collection<? extends E> coll)
-
clear
public void clear()
-
contains
public boolean contains(Object obj)
-
containsAll
public boolean containsAll(Collection<?> coll)
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
isEmpty
public boolean isEmpty()
-
remove
public boolean remove(Object obj)
-
removeAll
public boolean removeAll(Collection<?> coll)
-
retainAll
public boolean retainAll(Collection<?> coll)
-
size
public int size()
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] arr)
-
hashCode
public int hashCode()
-
-