public final class ObjectIntMap
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ObjectIntMap.Entry
The structure used for chaining colliding keys.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EOL |
private ObjectIntMap.Entry[] |
m_buckets |
private float |
m_loadFactor |
private int |
m_size |
private int |
m_sizeThreshold |
Constructor and Description |
---|
ObjectIntMap()
Equivalent to
IntObjectMap(11, 0.75F) . |
ObjectIntMap(int initialCapacity)
Equivalent to
IntObjectMap(capacity, 0.75F) . |
ObjectIntMap(int initialCapacity,
float loadFactor)
Constructs an IntObjectMap with specified initial capacity and load factor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.Object key) |
(package private) void |
debugDump(java.lang.StringBuffer out) |
boolean |
get(java.lang.Object key,
int[] out)
Returns the value that is mapped to a given 'key'.
|
java.lang.Object[] |
keys() |
void |
put(java.lang.Object key,
int value)
Updates the table to map 'key' to 'value'.
|
private void |
rehash()
Re-hashes the table into a new array of buckets.
|
void |
remove(java.lang.Object key)
Updates the table to map 'key' to 'value'.
|
int |
size()
Returns the number of key-value mappings in this map.
|
java.lang.String |
toString()
Overrides Object.toString() for debug purposes.
|
private final float m_loadFactor
private ObjectIntMap.Entry[] m_buckets
private int m_size
private int m_sizeThreshold
private static final java.lang.String EOL
public ObjectIntMap()
IntObjectMap(11, 0.75F)
.public ObjectIntMap(int initialCapacity)
IntObjectMap(capacity, 0.75F)
.public ObjectIntMap(int initialCapacity, float loadFactor)
initialCapacity
- initial number of hash buckets in the table [may not be negative, 0 is equivalent to 1].loadFactor
- the load factor to use to determine rehashing points [must be in (0.0, 1.0] range].public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public boolean contains(java.lang.Object key)
public boolean get(java.lang.Object key, int[] out)
key
- mapping key [may not be null]out
- holder for the found value [must be at least of size 1]public java.lang.Object[] keys()
public void put(java.lang.Object key, int value)
key
- mapping key [may not be null]value
- mapping value.public void remove(java.lang.Object key)
key
- mapping key [may not be null]void debugDump(java.lang.StringBuffer out)
private void rehash()