|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.util.IntIntMap
public class IntIntMap
An int int map is like an int map, but with integers as values as well as keys. Note that in situations where null would normally be returned to indicate no value, -1 is returned instead. This means that you must be careful if you intend to store -1 as a valid value in the table.
| Nested Class Summary | |
|---|---|
static interface |
IntIntMap.IntIntEntry
|
protected class |
IntIntMap.KeyValueInterator
|
| Field Summary | |
|---|---|
protected float |
_loadFactor
|
protected int |
_modCount
|
static int |
DEFAULT_BUCKETS
|
static float |
DEFAULT_LOAD_FACTOR
The default load factor. |
| Constructor Summary | |
|---|---|
IntIntMap()
|
|
IntIntMap(int buckets)
|
|
IntIntMap(int buckets,
float loadFactor)
|
|
| Method Summary | |
|---|---|
protected void |
checkShrink()
Check to see if we want to shrink the table. |
void |
clear()
|
boolean |
contains(int key)
|
void |
ensureCapacity(int minCapacity)
Ensure that the hash can comfortably hold the specified number of elements. |
Set<IntIntMap.IntIntEntry> |
entrySet()
Get a set of all the entries in this map. |
int |
get(int key)
|
int[] |
getKeys()
Get an array of the unique keys in this map. |
int[] |
getValues()
Get an array of the values that may be in this map. |
int |
increment(int key,
int amount)
Increments the value associated with the specified key by the specified amount. |
boolean |
isEmpty()
|
Interator |
keys()
|
protected com.samskivert.util.IntIntMap.Record |
locateRecord(int key)
Internal method to locate the record for the specified key. |
void |
put(int key,
int value)
|
int |
remove(int key)
|
protected int |
removeImpl(int key)
|
protected void |
resizeBuckets(int newsize)
Resize the hashtable. |
int |
size()
|
protected int[] |
toIntArray(boolean keys)
|
String |
toString()
|
Interator |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BUCKETS
public static final float DEFAULT_LOAD_FACTOR
protected float _loadFactor
protected int _modCount
| Constructor Detail |
|---|
public IntIntMap(int buckets,
float loadFactor)
public IntIntMap(int buckets)
public IntIntMap()
| Method Detail |
|---|
public boolean isEmpty()
public int size()
public void put(int key,
int value)
public int get(int key)
public int increment(int key,
int amount)
public boolean contains(int key)
protected com.samskivert.util.IntIntMap.Record locateRecord(int key)
public int remove(int key)
protected int removeImpl(int key)
public void clear()
public void ensureCapacity(int minCapacity)
protected void checkShrink()
protected void resizeBuckets(int newsize)
newsize - The new number of buckets to allocate.public Interator keys()
public Interator values()
public int[] getKeys()
public int[] getValues()
public String toString()
toString in class Objectprotected int[] toIntArray(boolean keys)
public Set<IntIntMap.IntIntEntry> entrySet()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||