java.lang.Object | |
↳ | org.jfree.data.KeyedObjects |
A collection of (key, object) pairs.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new collection (initially empty).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new object to the collection, or overwrites an existing object.
| |||||||||||
Clears all values from the collection.
| |||||||||||
Returns a clone of this object.
| |||||||||||
Tests this object for equality with an arbitrary object.
| |||||||||||
Returns the index for a given key, or
-1 . | |||||||||||
Returns the number of items (values) in the collection.
| |||||||||||
Returns the key at the specified position in the list.
| |||||||||||
Returns a list containing all the keys in the list.
| |||||||||||
Returns the object for a given key.
| |||||||||||
Returns an object from the list.
| |||||||||||
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.
| |||||||||||
Removes a value from the collection.
| |||||||||||
Removes a value from the collection.
| |||||||||||
Replaces an existing object, or adds a new object to the collection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new collection (initially empty).
Adds a new object to the collection, or overwrites an existing object.
This is the same as the setObject(Comparable, Object)
method.
key | the key. |
---|---|
object | the object. |
Clears all values from the collection.
Returns a clone of this object. Keys in the list should be immutable and are not cloned. Objects in the list are cloned only if they implement PublicCloneable.
CloneNotSupportedException | if there is a problem cloning. |
---|
Tests this object for equality with an arbitrary object.
obj | the object (null permitted). |
---|
Returns the index for a given key, or -1
.
key | the key (null not permitted). |
---|
-1
if the key is unrecognised.Returns the number of items (values) in the collection.
Returns the key at the specified position in the list.
index | the item index (zero-based). |
---|
IndexOutOfBoundsException | if item is out of bounds. |
---|
Returns a list containing all the keys in the list.
null
).
Returns the object for a given key. If the key is not recognised, the
method should return null
.
key | the key. |
---|
null
).Returns an object from the list.
item | the item index (zero-based). |
---|
null
).IndexOutOfBoundsException | if item is out of bounds.
|
---|
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 (null permitted). |
Removes a value from the collection.
key | the key (null not permitted). |
---|
UnknownKeyException | if the key is not recognised. |
---|
Removes a value from the collection.
index | the index of the item to remove. |
---|
Replaces an existing object, or adds a new object to the collection.
This is the same as the addObject(Comparable, Object)
method.
key | the key (null not permitted). |
---|---|
object | the object. |