Class MultiValueHashMap<K,V>
java.lang.Object
org.hsqldb.lib.MultiValueHashMap<K,V>
- All Implemented Interfaces:
Map<K,V>
A Map of Object keys to Object values which stores multiple values per
key. The getValuesIterator(K key) method returns an iterator covering the
values associated with the given key. The get(K key) method returns the first
value (if any) associated with the key.
This class does not store null keys.
- Since:
- 1.9.0
- Author:
- Fred Toussi (fredt@users dot sourceforge.net)
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMultiValueHashMap(int initialCapacity) MultiValueHashMap(int initialCapacity, ObjectComparator<K> comparator) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the map completely.org.hsqldb.map.BaseHashMapclone()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()Returns one of the values associated with the given key.getValuesIterator(Object key) Returns an iterator on all values associated with the key.booleanisEmpty()keySet()<T> T[]keysToArray(T[] array) voidvoidputAll(MultiValueHashMap<K, V> m) Removes all values associated with the key.booleanRemoves the spacific value associated with the key.intsize()intvalueCount(K key) Counts the values associated with the key.values()<T> T[]valuesToArray(T[] array)
-
Field Details
-
ACCESS_MAX
public static final int ACCESS_MAX- See Also:
-
emptyObjectArray
-
-
Constructor Details
-
MultiValueHashMap
public MultiValueHashMap() -
MultiValueHashMap
- Throws:
IllegalArgumentException
-
MultiValueHashMap
public MultiValueHashMap(int initialCapacity, ObjectComparator<K> comparator) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
-
Method Details
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
getValuesIterator
-
put
-
remove
-
remove
-
valueCount
Counts the values associated with the key.- Parameters:
key- the key- Returns:
- the count
-
putAll
-
putAll
-
keysToArray
public <T> T[] keysToArray(T[] array) -
valuesToArray
public <T> T[] valuesToArray(T[] array) -
keySet
-
values
-
entrySet
-
clear
public void clear()Clear the map completely. -
size
public int size() -
isEmpty
public boolean isEmpty() -
clone
public org.hsqldb.map.BaseHashMap clone()
-