Class ConcurrentLongHashSet
java.lang.Object
org.apache.activemq.artemis.utils.collections.ConcurrentLongHashSet
Concurrent hash set for primitive longs
Provides similar methods as a ConcurrentSet<Long> but since it's an open hash map with linear probing, no node allocations are required to store the values.
Items MUST be >= 0.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConcurrentLongHashSet(int expectedItems) ConcurrentLongHashSet(int expectedItems, int numSections) -
Method Summary
-
Constructor Details
-
ConcurrentLongHashSet
public ConcurrentLongHashSet() -
ConcurrentLongHashSet
public ConcurrentLongHashSet(int expectedItems) -
ConcurrentLongHashSet
public ConcurrentLongHashSet(int expectedItems, int numSections)
-
-
Method Details
-
size
public int size() -
capacity
public long capacity() -
isEmpty
public boolean isEmpty() -
contains
public boolean contains(long item) -
add
public boolean add(long item) -
remove
public boolean remove(long item) Remove an existing entry if found- Returns:
- true if removed or false if item was not present
-
clear
public void clear() -
forEach
-
items
- Returns:
- a new list of all keys (makes a copy)
-