Class ConcurrentLongHashSet
- java.lang.Object
-
- org.apache.activemq.artemis.utils.collections.ConcurrentLongHashSet
-
public class ConcurrentLongHashSet extends java.lang.ObjectConcurrent 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 Modifier and Type Class Description static interfaceConcurrentLongHashSet.ConsumerLong
-
Constructor Summary
Constructors Constructor Description ConcurrentLongHashSet()ConcurrentLongHashSet(int expectedItems)ConcurrentLongHashSet(int expectedItems, int numSections)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(long item)longcapacity()voidclear()booleancontains(long item)voidforEach(ConcurrentLongHashSet.ConsumerLong processor)booleanisEmpty()java.util.Set<java.lang.Long>items()booleanremove(long item)Remove an existing entry if foundintsize()
-
-
-
Method Detail
-
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- Parameters:
item-- Returns:
- true if removed or false if item was not present
-
clear
public void clear()
-
forEach
public void forEach(ConcurrentLongHashSet.ConsumerLong processor)
-
items
public java.util.Set<java.lang.Long> items()
- Returns:
- a new list of all keys (makes a copy)
-
-