Save This Page
Home » jcommon-1.0.13 » org.jfree.util » [javadoc | source]
org.jfree.util
public class: HashNMap [javadoc | source]
java.lang.Object
   org.jfree.util.HashNMap

All Implemented Interfaces:
    Cloneable, Serializable

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:
 public HashNMap() 
Method from org.jfree.util.HashNMap Summary:
add,   clear,   clone,   contains,   containsKey,   containsValue,   containsValue,   createList,   get,   getAll,   getFirst,   getValueCount,   keySet,   keys,   put,   remove,   removeAll,   toArray,   toArray
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.util.HashNMap Detail:
 public boolean add(Object key,
    Object val) 
    Adds a new key/value pair into this map. If the key is not yet in the map, it gets added to the map and the call is equal to put(Object,Object).
 public  void clear() 
    Clears all keys and values of this map.
 public Object clone() throws CloneNotSupportedException 
    Creates a deep copy of this HashNMap.
 public boolean contains(Object value) 
    Tests whether this map contains the given key or value.
 public boolean containsKey(Object key) 
    Tests whether this map contains the given key.
 public boolean containsValue(Object value) 
    Tests whether this map contains the given value.
 public boolean containsValue(Object key,
    Object value) 
    Tests whether this map contains the given value.
 protected List createList() 
    Returns a new empty list.
 public 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. An index out of bounds exception is thrown if there are less than n elements registered to this key.
 public Iterator getAll(Object key) 
    Returns an iterator over all elements registered to the given key.
 public Object getFirst(Object key) 
    Retrieves the first value registered for an key or null if there was no such key in the list.
 public int getValueCount(Object key) 
    Returns the number of elements registered with the given key.
 public Set keySet() 
    Returns all registered keys as set.
 public Iterator keys() 
    Returns all registered keys as an enumeration.
 public boolean put(Object key,
    Object val) 
    Inserts a new key/value pair into the map. If such a pair already exists, it gets replaced with the given values.
 public boolean remove(Object key,
    Object value) 
    Removes the key/value pair from the map. If the removed entry was the last entry for this key, the key gets also removed.
 public  void removeAll(Object key) 
    Removes all elements for the given key.
 public Object[] toArray(Object key) 
    Returns the contents for the given key as object array. If there were no objects registered with that key, an empty object array is returned.
 public Object[] toArray(Object key,
    Object[] data) 
    Returns the contents for the given key as object array. If there were no objects registered with that key, an empty object array is returned.