| gnu.trove.THashMap
THashMap | public class THashMap extends TObjectHash implements Map<K, V>,Externalizable(Code) | | An implementation of the Map interface which uses an open addressed
hash table to store its contents.
Created: Sun Nov 4 08:52:45 2001
author: Eric D. Friedman version: $Id: THashMap.java,v 1.26 2007/06/29 20:03:10 robeden Exp $ |
Inner Class :protected class ValueView extends MapBackedView | |
Inner Class :protected class EntryView extends MapBackedView> | |
Inner Class :protected class KeyView extends MapBackedView | |
Inner Class :final class Entry implements Map.Entry<K, V> | |
Constructor Summary | |
public | THashMap() Creates a new THashMap instance with the default
capacity and load factor. | public | THashMap(TObjectHashingStrategy<K> strategy) Creates a new THashMap instance with the default
capacity and load factor. | public | THashMap(int initialCapacity) Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor. | public | THashMap(int initialCapacity, TObjectHashingStrategy<K> strategy) Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor. | public | THashMap(int initialCapacity, float loadFactor) Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor. | public | THashMap(int initialCapacity, float loadFactor, TObjectHashingStrategy<K> strategy) Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor. | public | THashMap(Map<K, V> map) Creates a new THashMap instance which contains the
key/value pairs in map. | public | THashMap(Map<K, V> map, TObjectHashingStrategy<K> strategy) Creates a new THashMap instance which contains the
key/value pairs in map. |
_values | protected transient V[] _values(Code) | | the values of the map
|
serialVersionUID | final static long serialVersionUID(Code) | | |
THashMap | public THashMap()(Code) | | Creates a new THashMap instance with the default
capacity and load factor.
|
THashMap | public THashMap(TObjectHashingStrategy<K> strategy)(Code) | | Creates a new THashMap instance with the default
capacity and load factor.
Parameters: strategy - used to compute hash codes and to compare objects. |
THashMap | public THashMap(int initialCapacity)(Code) | | Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
Parameters: initialCapacity - an int value |
THashMap | public THashMap(int initialCapacity, TObjectHashingStrategy<K> strategy)(Code) | | Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the default load factor.
Parameters: initialCapacity - an int value Parameters: strategy - used to compute hash codes and to compare objects. |
THashMap | public THashMap(int initialCapacity, float loadFactor)(Code) | | Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
Parameters: initialCapacity - an int value Parameters: loadFactor - a float value |
THashMap | public THashMap(int initialCapacity, float loadFactor, TObjectHashingStrategy<K> strategy)(Code) | | Creates a new THashMap instance with a prime
capacity equal to or greater than initialCapacity and
with the specified load factor.
Parameters: initialCapacity - an int value Parameters: loadFactor - a float value Parameters: strategy - used to compute hash codes and to compare objects. |
THashMap | public THashMap(Map<K, V> map)(Code) | | Creates a new THashMap instance which contains the
key/value pairs in map.
Parameters: map - a Map value |
THashMap | public THashMap(Map<K, V> map, TObjectHashingStrategy<K> strategy)(Code) | | Creates a new THashMap instance which contains the
key/value pairs in map.
Parameters: map - a Map value Parameters: strategy - used to compute hash codes and to compare objects. |
clear | public void clear()(Code) | | Empties the map.
|
clone | public THashMap<K, V> clone()(Code) | | a shallow clone of this collection |
containsKey | public boolean containsKey(Object key)(Code) | | checks for the present of key in the keys of the map.
Parameters: key - an Object value a boolean value |
containsValue | public boolean containsValue(Object val)(Code) | | checks for the presence of val in the values of the map.
Parameters: val - an Object value a boolean value |
entrySet | public Set<Map.Entry<K, V>> entrySet()(Code) | | Returns a Set view on the entries of the map.
a Set value |
equals | public boolean equals(Object other)(Code) | | Compares this map with another map for equality of their stored
entries.
Parameters: other - an Object value a boolean value |
forEachEntry | public boolean forEachEntry(TObjectObjectProcedure<K, V> procedure)(Code) | | Executes procedure for each key/value entry in the
map.
Parameters: procedure - a TObjectObjectProcedure value false if the loop over the entries terminated becausethe procedure returned false for some entry. |
forEachKey | public boolean forEachKey(TObjectProcedure<K> procedure)(Code) | | Executes procedure for each key in the map.
Parameters: procedure - a TObjectProcedure value false if the loop over the keys terminated becausethe procedure returned false for some key. |
forEachValue | public boolean forEachValue(TObjectProcedure<V> procedure)(Code) | | Executes procedure for each value in the map.
Parameters: procedure - a TObjectProcedure value false if the loop over the values terminated becausethe procedure returned false for some value. |
get | public V get(Object key)(Code) | | retrieves the value for key
Parameters: key - an Object value the value of key or null if no such mapping exists. |
hashCode | public int hashCode()(Code) | | |
keySet | public Set<K> keySet()(Code) | | returns a Set view on the keys of the map.
a Set value |
put | public V put(K key, V value)(Code) | | Inserts a key/value pair into the map.
Parameters: key - an Object value Parameters: value - an Object value the previous value associated with key,or null if none was found. |
putAll | public void putAll(Map<? extends K, ? extends V> map)(Code) | | copies the key/value mappings in map into this map.
Parameters: map - a Map value |
rehash | protected void rehash(int newCapacity)(Code) | | rehashes the map to the new capacity.
Parameters: newCapacity - an int value |
remove | public V remove(Object key)(Code) | | Deletes a key/value pair from the map.
Parameters: key - an Object value an Object value |
removeAt | protected void removeAt(int index)(Code) | | removes the mapping at index from the map.
Parameters: index - an int value |
retainEntries | public boolean retainEntries(TObjectObjectProcedure<K, V> procedure)(Code) | | Retains only those entries in the map for which the procedure
returns a true value.
Parameters: procedure - determines which entries to keep true if the map was modified. |
setUp | protected int setUp(int initialCapacity)(Code) | | initialize the value array of the map.
Parameters: initialCapacity - an int value an int value |
transformValues | public void transformValues(TObjectFunction<V, V> function)(Code) | | Transform the values in this map using function.
Parameters: function - a TObjectFunction value |
values | public Collection<V> values()(Code) | | Returns a view on the values of the map.
a Collection value |
|
|