| java.lang.Object org.jfree.data.DefaultKeyedValues
Constructor Summary | |
public | DefaultKeyedValues() Creates a new collection (initially empty). |
Method Summary | |
public void | addValue(Comparable key, double value) Updates an existing value, or adds a new value to the collection. | public void | addValue(Comparable key, Number value) Adds a new value to the collection, or updates an existing value. | public void | clear() Clears all values from the collection. | public Object | clone() Returns a clone. | public boolean | equals(Object obj) Tests if this object is equal to another.
Parameters: obj - the object (null permitted). | public int | getIndex(Comparable key) Returns the index for a given key.
Parameters: key - the key (null not permitted). | 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 for the values in the collection. | public Number | getValue(int item) Returns a value.
Parameters: item - the item of interest (zero-based index). | public Number | getValue(Comparable key) Returns the value for a given key.
Parameters: key - the key (null not permitted). | public int | hashCode() Returns a hash code. | public void | insertValue(int position, Comparable key, double value) Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position. | public void | insertValue(int position, Comparable key, Number value) Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position. | public void | removeValue(int index) Removes a value from the collection. | public void | removeValue(Comparable key) Removes a value from the collection. | public void | setValue(Comparable key, double value) Updates an existing value, or adds a new value to the collection. | public void | setValue(Comparable key, Number value) Updates an existing value, or adds a new value to the collection. | public void | sortByKeys(SortOrder order) Sorts the items in the list by key. | public void | sortByValues(SortOrder order) Sorts the items in the list by value. |
DefaultKeyedValues | public DefaultKeyedValues()(Code) | | Creates a new collection (initially empty).
|
clear | public void clear()(Code) | | Clears all values from the collection.
since: 1.0.2 |
equals | public boolean equals(Object obj)(Code) | | Tests if this object is equal to another.
Parameters: obj - the object (null permitted). A boolean. |
getIndex | public int getIndex(Comparable key)(Code) | | Returns the index for a given key.
Parameters: key - the key (null not permitted). The index, or -1 if the key is not recognised. throws: IllegalArgumentException - if key is null . |
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 for the values in the collection.
The keys (never null ). |
getValue | public Number getValue(int item)(Code) | | Returns a value.
Parameters: item - the item of interest (zero-based index). The value. throws: IndexOutOfBoundsException - if item is out of bounds. |
hashCode | public int hashCode()(Code) | | Returns a hash code.
A hash code. |
insertValue | public void insertValue(int position, Comparable key, double value)(Code) | | Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position.
Parameters: position - the position (in the range 0 to getItemCount()). Parameters: key - the key (null not permitted). Parameters: value - the value. since: 1.0.6 |
insertValue | public void insertValue(int position, Comparable key, Number value)(Code) | | Inserts a new value at the specified position in the dataset or, if
there is an existing item with the specified key, updates the value
for that item and moves it to the specified position.
Parameters: position - the position (in the range 0 to getItemCount()). Parameters: key - the key (null not permitted). Parameters: value - the value (null permitted). since: 1.0.6 |
removeValue | public void removeValue(int index)(Code) | | Removes a value from the collection.
Parameters: index - the index of the item to remove (in the range 0 to getItemCount() - 1 ). throws: IndexOutOfBoundsException - if index is not withinthe specified range. |
removeValue | public void removeValue(Comparable key)(Code) | | Removes a value from the collection. If there is no item with the
specified key, this method does nothing.
Parameters: key - the item key (null not permitted). throws: IllegalArgumentException - if key is null . |
setValue | public void setValue(Comparable key, double value)(Code) | | Updates an existing value, or adds a new value to the collection.
Parameters: key - the key (null not permitted). Parameters: value - the value. |
setValue | public void setValue(Comparable key, Number value)(Code) | | Updates an existing value, or adds a new value to the collection.
Parameters: key - the key (null not permitted). Parameters: value - the value (null permitted). |
sortByKeys | public void sortByKeys(SortOrder order)(Code) | | Sorts the items in the list by key.
Parameters: order - the sort order (null not permitted). |
sortByValues | public void sortByValues(SortOrder order)(Code) | | Sorts the items in the list by value. If the list contains
null values, they will sort to the end of the list,
irrespective of the sort order.
Parameters: order - the sort order (null not permitted). |
|
|