org.jfree.data
Class DefaultKeyedValue
java.lang.Objectorg.jfree.data.DefaultKeyedValue
- Cloneable, KeyedValue, PublicCloneable, Serializable, Value
extends java.lang.Object
implements KeyedValue, Cloneable, PublicCloneable, Serializable
A (key, value) pair. This class provides a default implementation
of the
KeyedValue interface.
Object | clone()- Returns a clone.
|
boolean | equals(Object obj)- Tests this key-value pair for equality with an arbitrary object.
|
Comparable | getKey()- Returns the key.
|
Number | getValue()- Returns the value.
|
int | hashCode()- Returns a hash code.
|
void | setValue(Number value)- Sets the value.
|
DefaultKeyedValue
public DefaultKeyedValue(Comparable key,
Number value) Creates a new (key, value) item.
key - the key (should be immutable).value - the value (null permitted).
clone
public Object clone()
throws CloneNotSupportedException Returns a clone. It is assumed that both the key and value are
immutable objects, so only the references are cloned, not the objects
themselves.
equals
public boolean equals(Object obj)
Tests this key-value pair for equality with an arbitrary object.
obj - the object (null permitted).
getValue
public Number getValue()
Returns the value.
- getValue in interface Value
- The value (possibly
null).
hashCode
public int hashCode()
Returns a hash code.
setValue
public void setValue(Number value)
Sets the value.
value - the value (null permitted).