org.apache.wicket.util.collections
Class ConcurrentHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
org.apache.wicket.util.collections.ConcurrentHashSet<E>
- Type Parameters:
E -
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>
public class ConcurrentHashSet<E>
- extends java.util.AbstractSet<E>
- implements java.util.Set<E>, java.lang.Cloneable, java.io.Serializable
This class implements the Set interface, backed by a ConcurrentHashMap instance.
- Author:
- Matt Tucker
- See Also:
- Serialized Form
|
Constructor Summary |
ConcurrentHashSet()
Constructs a new, empty set; the backing ConcurrentHashMap instance has default
initial capacity (16) and load factor (0.75). |
ConcurrentHashSet(java.util.Collection<? extends E> c)
Constructs a new set containing the elements in the specified collection. |
ConcurrentHashSet(int initialCapacity)
Constructs a new, empty set; the backing HashMap instance has the specified initial
capacity and default load factor, which is 0.75. |
ConcurrentHashSet(int initialCapacity,
float loadFactor)
Constructs a new, empty set; the backing ConcurrentHashMap instance has the
specified initial capacity and the specified load factor. |
| Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
ConcurrentHashSet
public ConcurrentHashSet()
- Constructs a new, empty set; the backing ConcurrentHashMap instance has default
initial capacity (16) and load factor (0.75).
ConcurrentHashSet
public ConcurrentHashSet(java.util.Collection<? extends E> c)
- Constructs a new set containing the elements in the specified collection. The
ConcurrentHashMap 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.
ConcurrentHashSet
public ConcurrentHashSet(int initialCapacity,
float loadFactor)
- Constructs a new, empty set; the backing ConcurrentHashMap instance has the
specified initial capacity and the specified load factor.
- Parameters:
initialCapacity - the initial capacity of the hash map.loadFactor - the load factor of the hash map.
- Throws:
java.lang.IllegalArgumentException - if the initial capacity is less than zero, or if the load factor is nonpositive.
ConcurrentHashSet
public ConcurrentHashSet(int initialCapacity)
- Constructs a new, empty set; the backing HashMap 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.
iterator
public java.util.Iterator<E> iterator()
- Specified by:
iterator in interface java.lang.Iterable<E>- Specified by:
iterator in interface java.util.Collection<E>- Specified by:
iterator in interface java.util.Set<E>- Specified by:
iterator in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.iterator()
size
public int size()
- Specified by:
size in interface java.util.Collection<E>- Specified by:
size in interface java.util.Set<E>- Specified by:
size in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.size()
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface java.util.Collection<E>- Specified by:
isEmpty in interface java.util.Set<E>- Overrides:
isEmpty in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.isEmpty()
contains
public boolean contains(java.lang.Object o)
- Specified by:
contains in interface java.util.Collection<E>- Specified by:
contains in interface java.util.Set<E>- Overrides:
contains in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.contains(java.lang.Object)
add
public boolean add(E o)
- Specified by:
add in interface java.util.Collection<E>- Specified by:
add in interface java.util.Set<E>- Overrides:
add in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.add(java.lang.Object)
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove in interface java.util.Collection<E>- Specified by:
remove in interface java.util.Set<E>- Overrides:
remove in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.remove(java.lang.Object)
clear
public void clear()
- Specified by:
clear in interface java.util.Collection<E>- Specified by:
clear in interface java.util.Set<E>- Overrides:
clear in class java.util.AbstractCollection<E>
- See Also:
AbstractCollection.clear()
clone
public java.lang.Object clone()
- Overrides:
clone in class java.lang.Object
- See Also:
Object.clone()
Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.