|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.sort.IntToIntArrayMap
public class IntToIntArrayMap
An implementation of IntToIntMap
that relies on serial searching, and
is therefore optimized for very small map sizes
Constructor Summary | |
---|---|
IntToIntArrayMap()
Create an initial empty map with default space allocation |
|
IntToIntArrayMap(int capacity)
Create an initial empty map with a specified initial capacity |
Method Summary | |
---|---|
void |
clear()
Clear the map. |
boolean |
find(int key)
Finds a key in the map. |
int |
get(int key)
Gets the value for this key. |
int |
getDefaultValue()
Get the default value used to indicate an unused entry |
IntIterator |
keyIterator()
Get an iterator over the integer key values held in the hash map. |
void |
put(int key,
int value)
Adds a key-value pair to the map. |
boolean |
remove(int key)
Removes a key from the map. |
void |
setDefaultValue(int defaultValue)
Set the value to be returned to indicate an unused entry |
int |
size()
Gets the size of the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntToIntArrayMap()
public IntToIntArrayMap(int capacity)
capacity
- the initial capacity (the number of entries that can be held
before more space is allocated)Method Detail |
---|
public void clear()
clear
in interface IntToIntMap
public boolean find(int key)
find
in interface IntToIntMap
key
- Key
public int get(int key)
get
in interface IntToIntMap
key
- Key
public int getDefaultValue()
getDefaultValue
in interface IntToIntMap
get(int)
if no entry
exists for the supplied keypublic IntIterator keyIterator()
The contents of the hash map must not be modified while this iterator remains in use
keyIterator
in interface IntToIntMap
public void put(int key, int value)
put
in interface IntToIntMap
key
- Keyvalue
- Valuepublic boolean remove(int key)
remove
in interface IntToIntMap
key
- Key to remove
public void setDefaultValue(int defaultValue)
setDefaultValue
in interface IntToIntMap
defaultValue
- the value to be returned by get(int)
if no entry
exists for the supplied keypublic int size()
size
in interface IntToIntMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |