public class IntMap
extends java.lang.Object
The convenience of IntMap is avoiding all the silly wrapping of integers.
Modifier and Type | Field and Description |
---|---|
private java.lang.Object[] |
_keys |
private int |
_prime |
private int |
_size |
private int[] |
_values |
static int |
NULL
Encoding of a null entry.
|
static int[] |
PRIMES |
Constructor and Description |
---|
IntMap()
Create a new IntMap.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the hashmap.
|
int |
get(java.lang.Object key)
Puts a new value in the property table with the appropriate flags
|
static int |
getBiggestPrime(int value) |
protected int |
hashCode(java.lang.Object value) |
int |
put(java.lang.Object key,
int value,
boolean isReplace)
Puts a new value in the property table with the appropriate flags
|
private void |
resize(int newSize)
Expands the property table
|
int |
size()
Returns the current number of entries in the map.
|
java.lang.String |
toString() |
public static final int NULL
private java.lang.Object[] _keys
private int[] _values
private int _size
private int _prime
public static final int[] PRIMES
public void clear()
public final int size()
public final int get(java.lang.Object key)
public final int put(java.lang.Object key, int value, boolean isReplace)
private void resize(int newSize)
protected int hashCode(java.lang.Object value)
public java.lang.String toString()
toString
in class java.lang.Object
public static int getBiggestPrime(int value)