E - the element typepublic class ConcurrentSet<E> extends MapDelegateSet<E> implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID
The serialVersionUID
|
| Constructor and Description |
|---|
ConcurrentSet()
Constructs a new, empty set; the backing ConcurrentHashMap instance has
default initial capacity (16) and load factor (0.75).
|
ConcurrentSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified
collection.
|
ConcurrentSet(int initialCapacity)
Constructs a new, empty set; the backing ConcurrentHashMap instance has
the specified initial capacity and default load factor, which is
0.75.
|
ConcurrentSet(int initialCapacity,
float loadFactor,
int concurrencyLevel)
Constructs a new, empty set; the backing ConcurrentHashMap instance has
the specified initial capacity and the specified load factor.
|
add, clear, contains, isEmpty, iterator, remove, size, toStringaddAll, containsAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitprivate static final long serialVersionUID
public ConcurrentSet()
public ConcurrentSet(java.util.Collection<? extends E> c)
c - the collection whose elements are to be placed into this set.java.lang.NullPointerException - if the specified collection is null.public ConcurrentSet(int initialCapacity,
float loadFactor,
int concurrencyLevel)
initialCapacity - the initial capacity. The implementation
performs internal sizing to accommodate this many elements.loadFactor - the load factor threshold, used to control resizing.
Resizing may be performed when the average number of elements per
bin exceeds this threshold.concurrencyLevel - the estimated number of concurrently
updating threads. The implementation performs internal sizing
to try to accommodate this many threads.java.lang.IllegalArgumentException - if the initial capacity is less
than zero, or if the load factor is nonpositive.public ConcurrentSet(int initialCapacity)
initialCapacity - the initial capacity of the hash table.java.lang.IllegalArgumentException - if the initial capacity is less
than zero.