Class HashNMap
java.lang.Object
org.jfree.util.HashNMap
- All Implemented Interfaces:
Serializable, Cloneable
The HashNMap can be used to store multiple values by a single key value. The
values stored can be retrieved using a direct query or by creating an
enumeration over the stored elements.
- Author:
- Thomas Morgner
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a new key/value pair into this map.voidclear()Clears all keys and values of this map.clone()Creates a deep copy of this HashNMap.booleanTests whether this map contains the given key or value.booleancontainsKey(Object key) Tests whether this map contains the given key.booleancontainsValue(Object value) Tests whether this map contains the given value.booleancontainsValue(Object key, Object value) Tests whether this map contains the given value.protected ListReturns a new empty list.Retrieves the n-th value registered for an key or null if there was no such key in the list.Returns an iterator over all elements registered to the given key.Retrieves the first value registered for an key or null if there was no such key in the list.intgetValueCount(Object key) Returns the number of elements registered with the given key.keys()Returns all registered keys as an enumeration.keySet()Returns all registered keys as set.booleanInserts a new key/value pair into the map.booleanRemoves the key/value pair from the map.voidRemoves all elements for the given key.Object[]Returns the contents for the given key as object array.Object[]Returns the contents for the given key as object array.
-
Constructor Details
-
HashNMap
public HashNMap()Default constructor.
-
-
Method Details
-
createList
-
put
-
add
-
getFirst
-
get
-
getAll
-
keys
-
keySet
-
remove
-
removeAll
-
clear
Clears all keys and values of this map. -
containsKey
Tests whether this map contains the given key.- Parameters:
key- the key.- Returns:
- true if the key is contained in the map
-
containsValue
Tests whether this map contains the given value.- Parameters:
value- the value.- Returns:
- true if the value is registered in the map for an key.
-
containsValue
Tests whether this map contains the given value.- Parameters:
key- the key under which to find the valuevalue- the value.- Returns:
- true if the value is registered in the map for an key.
-
contains
-
clone
Creates a deep copy of this HashNMap.- Overrides:
clonein classObject- Returns:
- a clone.
- Throws:
CloneNotSupportedException- this should never happen.
-
toArray
-
toArray
-
getValueCount
Returns the number of elements registered with the given key.- Parameters:
key- the key.- Returns:
- the number of element for this key, or 0 if there are no elements registered.
-