|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.data.KeyedObjects
A collection of (key, object) pairs.
Constructor Summary | |
KeyedObjects()
Creates a new collection (initially empty). |
Method Summary | |
void |
addObject(java.lang.Comparable key,
java.lang.Object object)
Adds a new object to the collection, or overwrites an existing object. |
int |
getIndex(java.lang.Comparable key)
Returns the index for a given key. |
int |
getItemCount()
Returns the number of items (values) in the collection. |
java.lang.Comparable |
getKey(int index)
Returns a key. |
java.util.List |
getKeys()
Returns the keys. |
java.lang.Object |
getObject(java.lang.Comparable key)
Returns the object (possibly null) for a given key. |
java.lang.Object |
getObject(int item)
Returns an object. |
void |
removeValue(java.lang.Comparable key)
Removes a value from the collection. |
void |
removeValue(int index)
Removes a value from the collection. |
void |
setObject(java.lang.Comparable key,
java.lang.Object object)
Replaces an existing object, or adds a new object to the collection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KeyedObjects()
Method Detail |
public int getItemCount()
public java.lang.Object getObject(int item)
item
- the item index (zero-based).
public java.lang.Comparable getKey(int index)
index
- the item index (zero-based).
public int getIndex(java.lang.Comparable key)
key
- the key.
public java.util.List getKeys()
public java.lang.Object getObject(java.lang.Comparable key)
If the key is not recognised, the method should return null.
key
- the key.
public void addObject(java.lang.Comparable key, java.lang.Object object)
This is the same as the setObject(...) method.
key
- the key.object
- the object.public void setObject(java.lang.Comparable key, java.lang.Object object)
This is the same as the addObject(...) method.
key
- the key.object
- the object.public void removeValue(int index)
index
- the index of the item to remove.public void removeValue(java.lang.Comparable key)
key
- the key of the item to remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |