| java.lang.Object com.versant.core.util.IntObjectHashMap
IntObjectHashMap | final public class IntObjectHashMap implements Serializable(Code) | | Specialized HashMap mapping int to Object. This is a cut and paste of
java.util.HashMap with the key hardcoded as int and some non-required
functionality removed.
|
Constructor Summary | |
public | IntObjectHashMap(int initialCapacity, float loadFactor) Constructs an empty IntObjectHashMap with the specified initial
capacity and load factor. | public | IntObjectHashMap(int initialCapacity) Constructs an empty IntObjectHashMap with the specified initial
capacity and the default load factor (0.75). | public | IntObjectHashMap() Constructs an empty IntObjectHashMap with the default initial capacity
(16) and the default load factor (0.75). |
Method Summary | |
public void | clear() Removes all mappings from this map. | public boolean | containsKey(int key) Returns true if this map contains a mapping for the
specified key. | public boolean | containsValue(Object value) Returns true if this map maps one or more keys to the
specified value.
Parameters: value - value whose presence in this map is to be tested. | public Object | get(int key) Returns the value to which the specified key is mapped in this identity
hash map, or null if the map contains no mapping for this key.
A return value of null does not necessarily indicate
that the map contains no mapping for the key; it is also possible that
the map explicitly maps the key to null. | public boolean | isEmpty() Returns true if this map contains no key-value mappings. | public Object | put(int key, Object value) Associates the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced.
Parameters: key - key with which the specified value is to be associated. Parameters: value - value to be associated with the specified key. | public Object | remove(int key) Removes the mapping for this key from this map if present.
Parameters: key - key whose mapping is to be removed from the map. | public int | size() Returns the number of key-value mappings in this map. | public String | toString() Returns a string representation of this map. |
IntObjectHashMap | public IntObjectHashMap(int initialCapacity, float loadFactor)(Code) | | Constructs an empty IntObjectHashMap with the specified initial
capacity and load factor.
Parameters: initialCapacity - The initial capacity. Parameters: loadFactor - The load factor. throws: IllegalArgumentException - if the initial capacity is negativeor the load factor is nonpositive. |
IntObjectHashMap | public IntObjectHashMap(int initialCapacity)(Code) | | Constructs an empty IntObjectHashMap with the specified initial
capacity and the default load factor (0.75).
Parameters: initialCapacity - the initial capacity. throws: IllegalArgumentException - if the initial capacity is negative. |
IntObjectHashMap | public IntObjectHashMap()(Code) | | Constructs an empty IntObjectHashMap with the default initial capacity
(16) and the default load factor (0.75).
|
clear | public void clear()(Code) | | Removes all mappings from this map.
|
containsKey | public boolean containsKey(int key)(Code) | | Returns true if this map contains a mapping for the
specified key.
Parameters: key - The key whose presence in this map is to be tested true if this map contains a mapping for the specifiedkey. |
containsValue | public boolean containsValue(Object value)(Code) | | Returns true if this map maps one or more keys to the
specified value.
Parameters: value - value whose presence in this map is to be tested. true if this map maps one or more keys to thespecified value. |
get | public Object get(int key)(Code) | | Returns the value to which the specified key is mapped in this identity
hash map, or null if the map contains no mapping for this key.
A return value of null does not necessarily indicate
that the map contains no mapping for the key; it is also possible that
the map explicitly maps the key to null. The
containsKey method may be used to distinguish these two cases.
Parameters: key - the key whose associated value is to be returned. the value to which this map maps the specified key, ornull if the map contains no mapping for this key. |
isEmpty | public boolean isEmpty()(Code) | | Returns true if this map contains no key-value mappings.
true if this map contains no key-value mappings. |
put | public Object put(int key, Object value)(Code) | | Associates the specified value with the specified key in this map.
If the map previously contained a mapping for this key, the old
value is replaced.
Parameters: key - key with which the specified value is to be associated. Parameters: value - value to be associated with the specified key. previous value associated with specified key, or nullif there was no mapping for key. A null return canalso indicate that the IntObjectHashMap previously associatednull with the specified key. |
remove | public Object remove(int key)(Code) | | Removes the mapping for this key from this map if present.
Parameters: key - key whose mapping is to be removed from the map. previous value associated with specified key, or nullif there was no mapping for key. A null return canalso indicate that the map previously associated nullwith the specified key. |
size | public int size()(Code) | | Returns the number of key-value mappings in this map.
the number of key-value mappings in this map. |
toString | public String toString()(Code) | | Returns a string representation of this map. The string representation
consists of a list of key-value mappings in the order returned by the
map's entrySet view's iterator, enclosed in braces
("{}"). Adjacent mappings are separated by the characters
", " (comma and space). Each key-value mapping is rendered as
the key followed by an equals sign ("=") followed by the
associated value. Keys and values are converted to strings as by
String.valueOf(Object).
This implementation creates an empty string buffer, appends a left
brace, and iterates over the map's entrySet view, appending
the string representation of each map.entry in turn. After
appending each entry except the last, the string ", " is
appended. Finally a right brace is appended. A string is obtained
from the stringbuffer, and returned.
a String representation of this map. |
|
|