java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.i2p.util.ConcurrentHashSet<E>
- Type Parameters:
E- type of elements in this set
- All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>
Implement on top of a ConcurrentHashMap with a dummy value.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ConcurrentHashSet.ConcurrentHashSet(int capacity) Create a new ConcurrentHashSet with the given capacity.Method Summary
All MethodsMethods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
containsAll, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
containsAll, retainAll, spliterator, toArray, toArray
Field Details
DUMMY
Placeholder value - only the map's keys matter_map
Constructor Details
ConcurrentHashSet
public ConcurrentHashSet()Create a new ConcurrentHashSet.ConcurrentHashSet
public ConcurrentHashSet(int capacity) Create a new ConcurrentHashSet with the given capacity.- Parameters:
capacity- the initial capacity
Method Details
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceSet<E>- Overrides:
addin classAbstractCollection<E>
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classAbstractCollection<E>
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceSet<E>- Overrides:
containsin classAbstractCollection<E>
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceSet<E>- Overrides:
isEmptyin classAbstractCollection<E>
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceSet<E>- Overrides:
removein classAbstractCollection<E>
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceSet<E>- Specified by:
sizein classAbstractCollection<E>
iterator
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceSet<E>- Overrides:
addAllin classAbstractCollection<E>