net.sf.saxon.sort

Interface IntToIntMap

public interface IntToIntMap extends Serializable

Interface defining a map from integers to integers
Method Summary
voidclear()
Clear the map.
booleanfind(int key)
Finds a key in the map.
intget(int key)
Gets the value for this key.
intgetDefaultValue()
Get the default value used to indicate an unused entry
IntIteratorkeyIterator()
Get an iterator over the integer key values held in the hash map
voidput(int key, int value)
Adds a key-value pair to the map.
booleanremove(int key)
Removes a key from the map.
voidsetDefaultValue(int defaultValue)
Set the value to be returned to indicate an unused entry
intsize()
Gets the size of the map.

Method Detail

clear

public void clear()
Clear the map.

find

public boolean find(int key)
Finds a key in the map.

Parameters: key Key

Returns: true if the key is mapped

get

public int get(int key)
Gets the value for this key.

Parameters: key Key

Returns: the value, or the default value if not found.

getDefaultValue

public int getDefaultValue()
Get the default value used to indicate an unused entry

Returns: the value to be returned by IntToIntMap if no entry exists for the supplied key

keyIterator

public IntIterator keyIterator()
Get an iterator over the integer key values held in the hash map

Returns: an iterator whose next() call returns the key values (in arbitrary order)

put

public void put(int key, int value)
Adds a key-value pair to the map.

Parameters: key Key value Value

remove

public boolean remove(int key)
Removes a key from the map.

Parameters: key Key to remove

Returns: true if the value was removed

setDefaultValue

public void setDefaultValue(int defaultValue)
Set the value to be returned to indicate an unused entry

Parameters: defaultValue the value to be returned by IntToIntMap if no entry exists for the supplied key

size

public int size()
Gets the size of the map.

Returns: the size