public class

DefaultKeyedValue

extends Object
implements Serializable Cloneable KeyedValue
java.lang.Object
   ↳ org.jfree.data.DefaultKeyedValue

Class Overview

A (key, value) pair. This class provides a default implementation of the KeyedValue interface.

Summary

Public Constructors
DefaultKeyedValue(Comparable key, Number value)
Creates a new (key, value) item.
Public Methods
Object clone()
Returns a clone.
boolean equals(Object obj)
Tests this key-value pair for equality with an arbitrary object.
Comparable getKey()
Returns the key.
Number getValue()
Returns the value.
int hashCode()
Returns a hash code.
synchronized void setValue(Number value)
Sets the value.
String toString()
Returns a string representing this instance, primarily useful for debugging.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.jfree.data.KeyedValue
From interface org.jfree.data.Value

Public Constructors

public DefaultKeyedValue (Comparable key, Number value)

Creates a new (key, value) item.

Parameters
key the key (should be immutable, null not permitted).
value the value (null permitted).

Public Methods

public Object 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.

public boolean equals (Object obj)

Tests this key-value pair for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Comparable getKey ()

Returns the key.

Returns
  • The key (never null).

public Number getValue ()

Returns the value.

Returns
  • The value (possibly null).

public int hashCode ()

Returns a hash code.

Returns
  • A hash code.

public synchronized void setValue (Number value)

Sets the value.

Parameters
value the value (null permitted).

public String toString ()

Returns a string representing this instance, primarily useful for debugging.

Returns
  • A string.