Class LongHashMap<T>
java.lang.Object
org.greenrobot.essentials.collections.LongHashMap<T>
- Type Parameters:
T- The value class to store.
- Direct Known Subclasses:
LongHashMap.Synchronized
An minimalistic hash map optimized for long keys. The default implementation is not thread-safe, but you can get a
synchronized variant using one of the static createSynchronized methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprotected static final intprivate intprivate LongHashMap.Entry<T>[]private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(long key) static <T> LongHashMap<T> Creates a synchronized (thread-safe) LongHashSet.static <T> LongHashMap<T> createSynchronized(int capacity) Creates a synchronized (thread-safe) LongHashSet using the given initial capacity.entries()Returns all entries in no particular order.get(long key) long[]keys()Returns all keys in no particular order.remove(long key) voidreserveRoom(int entryCount) Target load: 0,6voidsetCapacity(int newCapacity) intsize()
-
Field Details
-
DEFAULT_CAPACITY
protected static final int DEFAULT_CAPACITY- See Also:
-
table
-
capacity
private int capacity -
threshold
private int threshold -
size
private volatile int size
-
-
Constructor Details
-
LongHashMap
public LongHashMap() -
LongHashMap
public LongHashMap(int capacity)
-
-
Method Details
-
createSynchronized
Creates a synchronized (thread-safe) LongHashSet. -
createSynchronized
Creates a synchronized (thread-safe) LongHashSet using the given initial capacity. -
containsKey
public boolean containsKey(long key) -
get
-
put
-
remove
-
keys
public long[] keys()Returns all keys in no particular order. -
entries
Returns all entries in no particular order. -
clear
public void clear() -
size
public int size() -
setCapacity
public void setCapacity(int newCapacity) -
reserveRoom
public void reserveRoom(int entryCount) Target load: 0,6
-