Module org.jfree.chart3d
Package org.jfree.chart3d.data

# Class DefaultKeyedValue<K extends Comparable<K>,T>

java.lang.Object
org.jfree.chart3d.data.DefaultKeyedValue<K,T>

All Implemented Interfaces:
  `Serializable`, `KeyedValue<K,T>`

public final class DefaultKeyedValue<K extends Comparable<K>,T> extends Object implements KeyedValue<K,T>, Serializable
A data item where a key is associated with a value (typically numerical).
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`DefaultKeyedValue(K key, T value)`
Creates a new instance.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this instance for equality with an arbitrary object.
`K`
`getKey()`
Returns the key.
`T`
`getValue()`
Returns the value.
`void`
`setValue(T value)`
Sets the value.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### DefaultKeyedValue

public DefaultKeyedValue(K key, T value)
Creates a new instance.

Parameters:
  `key` - the key (`null` not permitted).
  `value` - the value.

## Method Details

### getKey

public K getKey()
Returns the key.

Specified by:
  `getKey` in interface `KeyedValue<K extends Comparable<K>,T>`
Returns:
  The key (never `null`).

### getValue

public T getValue()
Returns the value.

Specified by:
  `getValue` in interface `KeyedValue<K extends Comparable<K>,T>`
Returns:
  The value (possibly `null`).

### setValue

public void setValue(T value)
Sets the value.

Parameters:
  `value` - the value (`null` permitted).

### equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object to test (`null` permitted).
Returns:
  A boolean.

### toString

public String toString()

Overrides:
  `toString` in class `Object`