Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jfree.data
Class DefaultKeyedValue

    java.lang.Object
      org.jfree.data.DefaultKeyedValue

All Implemented Interfaces:
  java.lang.Cloneable, KeyedValue, java.io.Serializable, Value

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

A (key, value) pair.

This class provides a default implementation of the `KeyedValue` interface.

See Also:
  Serialized Form

Constructor Summary
`DefaultKeyedValue(java.lang.Comparable key, java.lang.Number value)` Creates a new (key, value) pair.

Method Summary
`java.lang.Object` | `clone()` Returns a clone.
`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.
`int` | `hashCode()` Returns a hash code.
`void` | `setValue(java.lang.Number value)` Sets the value.

Methods inherited from class java.lang.Object
`finalize, getClass, 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.

  Parameters:
    `o` - the other object.
  Returns:
    A boolean.

### hashCode

    public int hashCode()

  Returns a hash code.

  Returns:
    a hash code.

### clone

    public java.lang.Object clone()
                           throws java.lang.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.

  Returns:
    A clone.
  Throws:
    `java.lang.CloneNotSupportedException` - Not thrown by this class, but subclasses (if any) might.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD