K - public class IntKeyMap<K>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
keys
Holds the keys
|
protected int |
size
Holds size
|
protected K[] |
values
Holds the values
|
| Constructor and Description |
|---|
IntKeyMap()
Constructor
|
IntKeyMap(java.util.List<java.lang.Object> keyValuePairs)
Creates an intHashMap from a list that contains keys and values in alternation
|
IntKeyMap(java.lang.Object... keyValuePairs)
Creates an intHashMap from a list that contains keys and values in alternation
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(int o) |
boolean |
containsKey(int key)
True if value is there
|
boolean |
equals(java.lang.Object o) |
protected int |
find(int key)
Finds a key, keys[find] will be Integer.MAX_VALUE if non-existent
|
K |
get(int key)
Retrieves a value
|
K |
get(int key,
K defaultValue)
Retrieves a value
|
int |
hashCode() |
protected int |
index(int key)
Returns an index where to store the object
|
protected int |
index(int key,
int len)
Returns an index where to store the object
|
boolean |
isEmpty()
TRUE if there is no mapping
|
java.util.Iterator<java.lang.Integer> |
iterator() |
PeekIterator<java.lang.Integer> |
keys()
Returns keys.
|
static void |
main(java.lang.String[] args)
Test
|
protected boolean |
put(int[] keys,
K[] values,
int key,
K value)
Adds a key, true for 'added the key as new', false for 'overwrote
existing value'
|
boolean |
put(int key,
K value)
Adds a key, true for 'added the key as new', false for 'overwrote
existing value'
|
protected void |
rehash()
Rehashes
|
int |
size() |
java.lang.String |
toString() |
protected int[] keys
protected K[] values
protected int size
public IntKeyMap()
public IntKeyMap(java.lang.Object... keyValuePairs)
public IntKeyMap(java.util.List<java.lang.Object> keyValuePairs)
protected int index(int key,
int len)
protected int index(int key)
public K get(int key)
protected int find(int key)
public boolean containsKey(int key)
public PeekIterator<java.lang.Integer> keys()
public boolean put(int key,
K value)
protected boolean put(int[] keys,
K[] values,
int key,
K value)
protected void rehash()
public java.util.Iterator<java.lang.Integer> iterator()
public int size()
public void clear()
public boolean contains(int o)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEmpty()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception