|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.libraries.base.util.HashNMap
public class HashNMap
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.
Constructor Summary | |
---|---|
HashNMap()
Default constructor. |
Method Summary | |
---|---|
boolean |
add(Object key,
Object val)
Adds a new key/value pair into this map. |
void |
clear()
Clears all keys and values of this map. |
Object |
clone()
Creates a deep copy of this HashNMap. |
boolean |
contains(Object value)
Tests whether this map contains the given key or value. |
boolean |
containsKey(Object key)
Tests whether this map contains the given key. |
boolean |
containsValue(Object value)
Tests whether this map contains the given value. |
boolean |
containsValue(Object key,
Object value)
Tests whether this map contains the given value. |
Object |
get(Object key,
int n)
Retrieves the n-th value registered for an key or null if there was no such key in the list. |
Iterator |
getAll(Object key)
Returns an iterator over all elements registered to the given key. |
Object |
getFirst(Object key)
Retrieves the first value registered for an key or null if there was no such key in the list. |
int |
getValueCount(Object key)
Returns the number of elements registered with the given key. |
boolean |
isEmpty()
Checks, whether the map is empty. |
Iterator |
keys()
Returns all registered keys as an enumeration. |
Set |
keySet()
Returns all registered keys as set. |
boolean |
put(Object key,
Object val)
Inserts a new key/value pair into the map. |
boolean |
remove(Object key,
Object value)
Removes the key/value pair from the map. |
void |
removeAll(Object key)
Removes all elements for the given key. |
Object[] |
toArray(Object key)
Returns the contents for the given key as object array. |
Object[] |
toArray(Object key,
Object[] data)
Returns the contents for the given key as object array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HashNMap()
Method Detail |
---|
public boolean put(Object key, Object val)
key
- the key.val
- the value.
public boolean add(Object key, Object val)
key
- the key.val
- the value.
public Object getFirst(Object key)
key
- the key.
public Object get(Object key, int n)
key
- the key.n
- the index.
public Iterator getAll(Object key)
key
- the key.
public Iterator keys()
public Set keySet()
public boolean remove(Object key, Object value)
key
- the key.value
- the value.
public void removeAll(Object key)
key
- the key.public void clear()
public boolean containsKey(Object key)
key
- the key.
public boolean containsValue(Object value)
value
- the value.
public boolean containsValue(Object key, Object value)
value
- the value.key
- the key under which to find the value
public boolean contains(Object value)
value
- the value.
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- this should never happen.public Object[] toArray(Object key, Object[] data)
key
- the key.data
- the object array to receive the contents.
public Object[] toArray(Object key)
key
- the key.
public int getValueCount(Object key)
key
- the key.
public boolean isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |