java.lang.Object | |
↳ | org.jfree.data.DefaultKeyedValues |
An ordered list of (key, value) items. This class provides a default
implementation of the KeyedValues
interface.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new collection (initially empty).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new value to the collection, or updates an existing value.
| |||||||||||
Updates an existing value, or adds a new value to the collection.
| |||||||||||
Clears all values from the collection.
| |||||||||||
Returns a clone.
| |||||||||||
Tests if this object is equal to another.
| |||||||||||
Returns the index for a given key.
| |||||||||||
Returns the number of items (values) in the collection.
| |||||||||||
Returns a key.
| |||||||||||
Returns the keys for the values in the collection.
| |||||||||||
Returns a value.
| |||||||||||
Returns the value for a given key.
| |||||||||||
Returns a hash 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.
| |||||||||||
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.
| |||||||||||
Removes a value from the collection.
| |||||||||||
Removes a value from the collection.
| |||||||||||
Updates an existing value, or adds a new value to the collection.
| |||||||||||
Updates an existing value, or adds a new value to the collection.
| |||||||||||
Sorts the items in the list by key.
| |||||||||||
Sorts the items in the list by value.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new collection (initially empty).
Adds a new value to the collection, or updates an existing value.
This method passes control directly to the
setValue(Comparable, Number)
method.
key | the key (null not permitted). |
---|---|
value | the value (null permitted).
|
Updates an existing value, or adds a new value to the collection.
key | the key (null not permitted). |
---|---|
value | the value. |
Clears all values from the collection.
Returns a clone.
CloneNotSupportedException | this class will not throw this exception, but subclasses might. |
---|
Tests if this object is equal to another.
obj | the object (null permitted). |
---|
Returns the index for a given key.
key | the key (null not permitted). |
---|
-1
if the key is not recognised.IllegalArgumentException | if key is
null .
|
---|
Returns the number of items (values) in the collection.
Returns a key.
index | the item index (zero-based). |
---|
IndexOutOfBoundsException | if item is out of bounds.
|
---|
Returns the keys for the values in the collection.
null
).
Returns a value.
item | the item of interest (zero-based index). |
---|
null
).IndexOutOfBoundsException | if item is out of bounds.
|
---|
Returns the value for a given key.
key | the key (null not permitted). |
---|
null
).UnknownKeyException | if the key is not recognised. |
---|
Returns a hash 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.
position | the position (in the range 0 to getItemCount()). |
---|---|
key | the key (null not permitted). |
value | the 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.
position | the position (in the range 0 to getItemCount()). |
---|---|
key | the key (null not permitted). |
value | the value (null permitted). |
Removes a value from the collection.
key | the item key (null not permitted). |
---|
IllegalArgumentException | if key is
null . |
---|---|
UnknownKeyException | if key is not recognised.
|
Removes a value from the collection.
index | the index of the item to remove (in the range
0 to getItemCount() - 1 ). |
---|
IndexOutOfBoundsException | if index is not within
the specified range.
|
---|
Updates an existing value, or adds a new value to the collection.
key | the key (null not permitted). |
---|---|
value | the value. |
Updates an existing value, or adds a new value to the collection.
key | the key (null not permitted). |
---|---|
value | the value (null permitted).
|
Sorts the items in the list by key.
order | the sort order (null not permitted).
|
---|
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.
order | the sort order (null not permitted).
|
---|