public class ConcurrentReferenceHashSet<E>
extends java.lang.Object
implements java.util.Set<E>, java.io.Serializable
refType
set to HARD
,
this uses a JDK1.5 ConcurrentHashMap
under the covers. Otherwise,
it uses a ConcurrentReferenceHashMap
.Modifier and Type | Field and Description |
---|---|
static int |
HARD
Hard reference marker.
|
static int |
SOFT
Soft reference marker.
|
static int |
WEAK
Weak reference marker.
|
Constructor and Description |
---|
ConcurrentReferenceHashSet(int refType)
Construct a set with the given reference type.
|
Modifier and Type | Method and 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) |
public static final int HARD
public static final int SOFT
public static final int WEAK
public ConcurrentReferenceHashSet(int refType)
public boolean add(E obj)
public boolean addAll(java.util.Collection<? extends E> coll)
public void clear()
public boolean contains(java.lang.Object obj)
public boolean containsAll(java.util.Collection<?> coll)
public boolean isEmpty()
public java.util.Iterator<E> iterator()
public boolean remove(java.lang.Object obj)
public boolean removeAll(java.util.Collection<?> coll)
public boolean retainAll(java.util.Collection<?> coll)
public int size()
public java.lang.Object[] toArray()
public <T> T[] toArray(T[] arr)
public int hashCode()