public class LongHashMap<V>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
LongHashMap.Entry<V> |
Modifier and Type | Field and Description |
---|---|
private int |
capacity
the maximum amount of elements in the hash (probably 3/4 the size due to meh hashing function)
|
private LongHashMap.Entry<V>[] |
hashArray |
private int |
mask |
private int |
modCount
count of times elements have been added/removed
|
private int |
numHashElements
the number of elements in the hash array
|
private float |
percentUseable
percent of the hasharray that can be used without hash colliding probably
|
Constructor and Description |
---|
LongHashMap() |
Modifier and Type | Method and Description |
---|---|
void |
add(long p_76163_1_,
V p_76163_3_)
Add a key-value pair.
|
boolean |
containsItem(long p_76161_1_) |
private void |
copyHashTableTo(LongHashMap.Entry<V>[] p_76154_1_)
copies the hash table to the specified array
|
private void |
createKey(int p_76156_1_,
long p_76156_2_,
V p_76156_4_,
int p_76156_5_)
creates the key in the hash table
|
(package private) LongHashMap.Entry<V> |
getEntry(long p_76160_1_) |
private static int |
getHashedKey(long originalKey)
returns the hashed key given the original key
|
private static int |
getHashIndex(int p_76158_0_,
int p_76158_1_)
gets the index in the hash given the array length and the hashed key
|
int |
getNumHashElements() |
V |
getValueByKey(long p_76164_1_)
get the value from the map given the key
|
private static int |
hash(int integer)
the hash function
|
V |
remove(long p_76159_1_)
calls the removeKey method and returns removed object
|
(package private) LongHashMap.Entry<V> |
removeKey(long p_76152_1_) |
private void |
resizeTable(int p_76153_1_)
resizes the table
|
private transient LongHashMap.Entry<V>[] hashArray
private transient int numHashElements
private int mask
private int capacity
private final float percentUseable
private transient volatile int modCount
private static int getHashedKey(long originalKey)
private static int hash(int integer)
private static int getHashIndex(int p_76158_0_, int p_76158_1_)
public int getNumHashElements()
public V getValueByKey(long p_76164_1_)
public boolean containsItem(long p_76161_1_)
final LongHashMap.Entry<V> getEntry(long p_76160_1_)
public void add(long p_76163_1_, V p_76163_3_)
private void resizeTable(int p_76153_1_)
private void copyHashTableTo(LongHashMap.Entry<V>[] p_76154_1_)
public V remove(long p_76159_1_)
final LongHashMap.Entry<V> removeKey(long p_76152_1_)
private void createKey(int p_76156_1_, long p_76156_2_, V p_76156_4_, int p_76156_5_)