public class IntKeyMap<K> extends 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(List<Object> keyValuePairs)
Creates an intHashMap from a list that contains keys and values in alternation
|
IntKeyMap(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(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
|
Iterator<Integer> |
iterator() |
PeekIterator<Integer> |
keys()
Returns keys.
|
static void |
main(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() |
String |
toString() |
protected int[] keys
protected K[] values
protected int size
public IntKeyMap()
public IntKeyMap(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<Integer> keys()
public boolean put(int key,
K value)
protected boolean put(int[] keys,
K[] values,
int key,
K value)
protected void rehash()
public int size()
public void clear()
public boolean contains(int o)
public boolean isEmpty()
Copyright © 2018. All rights reserved.