public class IntHashMap<V>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
IntHashMap.Entry<V> |
Modifier and Type | Field and Description |
---|---|
private int |
count
The number of items stored in this map
|
private float |
growFactor
The scale factor used to determine when to grow the table
|
private IntHashMap.Entry<V>[] |
slots |
private int |
threshold
The grow threshold
|
Constructor and Description |
---|
IntHashMap() |
Modifier and Type | Method and Description |
---|---|
void |
addKey(int p_76038_1_,
V p_76038_2_)
Adds a key and associated value to this map
|
void |
clearMap()
Removes all entries from the map
|
private static int |
computeHash(int integer)
Makes the passed in integer suitable for hashing by a number of shifts
|
boolean |
containsItem(int p_76037_1_)
Returns true if this hash table contains the specified item.
|
private void |
copyTo(IntHashMap.Entry<V>[] p_76048_1_)
Copies the hash slots to a new array
|
private static int |
getSlotIndex(int hash,
int slotCount)
Computes the index of the slot for the hash and slot count passed in.
|
private void |
grow(int p_76047_1_)
Increases the number of hash slots
|
private void |
insert(int p_76040_1_,
int p_76040_2_,
V p_76040_3_,
int p_76040_4_)
Adds an object to a slot
|
V |
lookup(int p_76041_1_)
Returns the object associated to a key
|
(package private) IntHashMap.Entry<V> |
lookupEntry(int p_76045_1_) |
(package private) IntHashMap.Entry<V> |
removeEntry(int p_76036_1_) |
V |
removeObject(int p_76049_1_)
Removes the specified object from the map and returns it
|
private transient IntHashMap.Entry<V>[] slots
private transient int count
private int threshold
private final float growFactor
private static int computeHash(int integer)
private static int getSlotIndex(int hash, int slotCount)
public V lookup(int p_76041_1_)
public boolean containsItem(int p_76037_1_)
final IntHashMap.Entry<V> lookupEntry(int p_76045_1_)
public void addKey(int p_76038_1_, V p_76038_2_)
private void grow(int p_76047_1_)
private void copyTo(IntHashMap.Entry<V>[] p_76048_1_)
public V removeObject(int p_76049_1_)
final IntHashMap.Entry<V> removeEntry(int p_76036_1_)
public void clearMap()
private void insert(int p_76040_1_, int p_76040_2_, V p_76040_3_, int p_76040_4_)