org.jfree.data
Class DefaultKeyedValue

java.lang.Object
  |
  +--org.jfree.data.DefaultKeyedValue
All Implemented Interfaces:
KeyedValue, java.io.Serializable, Value

public class DefaultKeyedValue
extends java.lang.Object
implements KeyedValue, java.io.Serializable

A (key, value) pair.

This class provides a default implementation of the KeyedValue interface.

Author:
David Gilbert
See Also:
Serialized Form

Constructor Summary
DefaultKeyedValue(java.lang.Comparable key, java.lang.Number value)
          Creates a new (key, value) pair.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests if this object is equal to another.
 java.lang.Comparable getKey()
          Returns the key.
 java.lang.Number getValue()
          Returns the value.
 void setValue(java.lang.Number value)
          Sets the value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultKeyedValue

public DefaultKeyedValue(java.lang.Comparable key,
                         java.lang.Number value)
Creates a new (key, value) pair.

Parameters:
key - the key.
value - the value (null permitted).
Method Detail

getKey

public java.lang.Comparable getKey()
Returns the key.

Specified by:
getKey in interface KeyedValue
Returns:
the key.

getValue

public java.lang.Number getValue()
Returns the value.

Specified by:
getValue in interface Value
Returns:
the value.

setValue

public void setValue(java.lang.Number value)
Sets the value.

Parameters:
value - the value.

equals

public boolean equals(java.lang.Object o)
Tests if this object is equal to another.

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object.
Returns:
A boolean.