| java.lang.Object net.sf.saxon.sort.IntToIntHashMap
IntToIntHashMap | public class IntToIntHashMap implements Serializable(Code) | | A hash table that maps int keys to int values.
author: Dave Hale, Landmark Graphics author: Dominique Devienne author: Michael Kay: created this class based on IntHashMap |
Constructor Summary | |
public | IntToIntHashMap() Initializes a map with a capacity of 8 and a load factor of 0,25. | public | IntToIntHashMap(int capacity) Initializes a map with the given capacity and a load factor of 0,25. | public | IntToIntHashMap(int capacity, double factor) Constructs a new map with initial capacity, and load factor.
The capacity is the number of keys that can be mapped without resizing
the arrays in which keys and values are stored. |
Method Summary | |
public void | clear() Clears the map. | public boolean | find(int key) Finds a key in the map. | public int | get(int key) Gets the value for this key. | public void | put(int key, int value) Adds a key-value pair to the map. | public boolean | remove(int key) Removes a key from the map. | public void | setDefaultValue(int defaultValue) | public int | size() Gets the size of the map. |
IntToIntHashMap | public IntToIntHashMap()(Code) | | Initializes a map with a capacity of 8 and a load factor of 0,25.
|
IntToIntHashMap | public IntToIntHashMap(int capacity)(Code) | | Initializes a map with the given capacity and a load factor of 0,25.
Parameters: capacity - the initial capacity. |
IntToIntHashMap | public IntToIntHashMap(int capacity, double factor)(Code) | | Constructs a new map with initial capacity, and load factor.
The capacity is the number of keys that can be mapped without resizing
the arrays in which keys and values are stored. For efficiency, only
a fraction of the elements in those arrays are used. That fraction is
the specified load factor. The initial length of the arrays equals the
smallest power of two not less than the ratio capacity/factor. The
capacity of the map is increased, as necessary. The maximum number
of keys that can be mapped is 2^30.
Parameters: capacity - the initial capacity. Parameters: factor - the load factor. |
clear | public void clear()(Code) | | Clears the map.
|
find | public boolean find(int key)(Code) | | Finds a key in the map.
Parameters: key - Key true if the key is mapped |
get | public int get(int key)(Code) | | Gets the value for this key.
Parameters: key - Key the value, null if not found. |
put | public void put(int key, int value)(Code) | | Adds a key-value pair to the map.
Parameters: key - Key Parameters: value - Value |
remove | public boolean remove(int key)(Code) | | Removes a key from the map.
Parameters: key - Key to remove true if the value was removed |
setDefaultValue | public void setDefaultValue(int defaultValue)(Code) | | Set the value to be returned to indicate an unused entry
|
size | public int size()(Code) | | Gets the size of the map.
the size |
|
|