Package org.jboss.util.collection
Class FastCopyHashSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- org.jboss.util.collection.MapDelegateSet<E>
-
- org.jboss.util.collection.FastCopyHashSet<E>
-
- Type Parameters:
E
- the element type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public class FastCopyHashSet<E> extends MapDelegateSet<E> implements java.io.Serializable
Concurrent Set based on top of FastCopyHashMap. It's serializable if the elements are serializable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
The serialVersionUID
-
Constructor Summary
Constructors Constructor Description FastCopyHashSet()
Constructs a new, empty set; the backing FastCopyHashMap instance has default initial capacity (16) and load factor (0.75).FastCopyHashSet(int initialCapacity)
Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and default load factor, which is 0.75.FastCopyHashSet(int initialCapacity, float loadFactor)
Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and the specified load factor.FastCopyHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection.
-
Method Summary
-
Methods inherited from class org.jboss.util.collection.MapDelegateSet
add, clear, contains, isEmpty, iterator, remove, size, toString
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialVersionUID- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FastCopyHashSet
public FastCopyHashSet()
Constructs a new, empty set; the backing FastCopyHashMap instance has default initial capacity (16) and load factor (0.75).
-
FastCopyHashSet
public FastCopyHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. The FastCopyHashMap is created with default load factor (0.75) and an initial capacity sufficient to contain the elements in the specified collection.- Parameters:
c
- the collection whose elements are to be placed into this set.- Throws:
java.lang.NullPointerException
- if the specified collection is null.
-
FastCopyHashSet
public FastCopyHashSet(int initialCapacity, float loadFactor)
Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and the specified load factor.- Parameters:
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.- Throws:
java.lang.IllegalArgumentException
- if the initial capacity is less than zero, or if the load factor is nonpositive.
-
FastCopyHashSet
public FastCopyHashSet(int initialCapacity)
Constructs a new, empty set; the backing FastCopyHashMap instance has the specified initial capacity and default load factor, which is 0.75.- Parameters:
initialCapacity
- the initial capacity of the hash table.- Throws:
java.lang.IllegalArgumentException
- if the initial capacity is less than zero.
-
-