com.orsoncharts.data

## Class DefaultKeyedValue<T>

- java.lang.Object
- - com.orsoncharts.data.DefaultKeyedValue<T>

- All Implemented Interfaces:
    KeyedValue<T>, java.io.Serializable

      public final class DefaultKeyedValue<T>
      extends java.lang.Object
      implements KeyedValue<T>, java.io.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 and Description
    `DefaultKeyedValue(java.lang.Comparable<?> key, T value)` Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)` Tests this instance for equality with an arbitrary object.
    `java.lang.Comparable<?>` | `getKey()` Returns the key.
    `T` | `getValue()` Returns the value.
    `void` | `setValue(T value)` Sets the value.
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### DefaultKeyedValue

          public DefaultKeyedValue(java.lang.Comparable<?> key,
                                   T value)

      Creates a new instance.
      Parameters:
        `key` - the key (`null` not permitted).
        `value` - the value.

  - ### Method Detail

    - #### getKey

          public java.lang.Comparable<?> getKey()

      Returns the key.
      Specified by:
        `getKey` in interface `KeyedValue<T>`
      Returns:
        The key (never `null`).

    - #### getValue

          public T getValue()

      Returns the value.
      Specified by:
        `getValue` in interface `KeyedValue<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(java.lang.Object obj)

      Tests this instance for equality with an arbitrary object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `obj` - the object to test (`null` permitted).
      Returns:
        A boolean.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`