Class ConcurrentReferenceHashSet<E>
- java.lang.Object
-
- org.apache.openjpa.lib.util.concurrent.ConcurrentReferenceHashSet<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public class ConcurrentReferenceHashSet<E> extends java.lang.Object implements java.util.Set<E>, java.io.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(java.util.Collection<? extends E> coll)
void
clear()
boolean
contains(java.lang.Object obj)
boolean
containsAll(java.util.Collection<?> coll)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object obj)
boolean
removeAll(java.util.Collection<?> coll)
boolean
retainAll(java.util.Collection<?> coll)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] arr)
-
-
-
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(java.util.Collection<? extends E> coll)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object obj)
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object obj)
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
-
size
public int size()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] arr)
-
hashCode
public int hashCode()
-
-