Package org.jfree.data
Class DefaultKeyedValue
java.lang.Object
org.jfree.data.DefaultKeyedValue
- All Implemented Interfaces:
Serializable
,Cloneable
,KeyedValue
,Value
public class DefaultKeyedValue extends Object implements KeyedValue, Cloneable, Serializable
A (key, value) pair.
This class provides a default implementation of the KeyedValue
interface.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DefaultKeyedValue(Comparable key, Number value)
Creates a new (key, value) pair. -
Method Summary
-
Constructor Details
-
DefaultKeyedValue
Creates a new (key, value) pair.- Parameters:
key
- the key.value
- the value (null
permitted).
-
-
Method Details
-
getKey
Returns the key.- Specified by:
getKey
in interfaceKeyedValue
- Returns:
- the key.
-
getValue
Returns the value. -
setValue
Sets the value.- Parameters:
value
- the value.
-
equals
Tests if this object is equal to another. -
hashCode
public int hashCode()Returns a hash code. -
clone
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.- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- Not thrown by this class, but subclasses (if any) might.
-