| java.lang.Object org.jfree.data.KeyedObjects
Constructor Summary | |
public | KeyedObjects() Creates a new collection (initially empty). |
Method Summary | |
public void | addObject(Comparable key, Object object) Adds a new object to the collection, or overwrites an existing object. | public Object | clone() Returns a clone of this object. | public boolean | equals(Object o) Tests if this object is equal to another.
Parameters: o - the other object. | public int | getIndex(Comparable key) Returns the index for a given key.
Parameters: key - the key. | public int | getItemCount() Returns the number of items (values) in the collection. | public Comparable | getKey(int index) Returns a key.
Parameters: index - the item index (zero-based). | public List | getKeys() Returns the keys. | public Object | getObject(int item) Returns an object.
Parameters: item - the item index (zero-based). | public Object | getObject(Comparable key) Returns the object for a given key. | public void | removeValue(int index) Removes a value from the collection. | public void | removeValue(Comparable key) Removes a value from the collection. | public void | setObject(Comparable key, Object object) Replaces an existing object, or adds a new object to the collection. |
KeyedObjects | public KeyedObjects()(Code) | | Creates a new collection (initially empty).
|
equals | public boolean equals(Object o)(Code) | | Tests if this object is equal to another.
Parameters: o - the other object. A boolean. |
getIndex | public int getIndex(Comparable key)(Code) | | Returns the index for a given key.
Parameters: key - the key. The index, or -1 if the key is unrecognised. |
getItemCount | public int getItemCount()(Code) | | Returns the number of items (values) in the collection.
The item count. |
getKeys | public List getKeys()(Code) | | Returns the keys.
The keys (never null ). |
getObject | public Object getObject(int item)(Code) | | Returns an object.
Parameters: item - the item index (zero-based). The object (null if the index is out of range). |
getObject | public Object getObject(Comparable key)(Code) | | Returns the object for a given key. If the key is not recognised, the
method should return null .
Parameters: key - the key. The object (possibly null ). |
removeValue | public void removeValue(int index)(Code) | | Removes a value from the collection.
Parameters: index - the index of the item to remove. |
removeValue | public void removeValue(Comparable key)(Code) | | Removes a value from the collection.
Parameters: key - the key of the item to remove. |
|
|