public class DefaultKeyedValue extends java.lang.Object implements KeyedValue, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
KeyedValue
interface.Constructor and Description |
---|
DefaultKeyedValue(java.lang.Comparable key,
java.lang.Number value)
Creates a new (key, value) item.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone.
|
boolean |
equals(java.lang.Object obj)
Tests this key-value pair for equality with an arbitrary object.
|
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.
|
java.lang.String |
toString()
Returns a string representing this instance, primarily useful for
debugging.
|
public DefaultKeyedValue(java.lang.Comparable key, java.lang.Number value)
key
- the key (should be immutable, null
not
permitted).value
- the value (null
permitted).public java.lang.Comparable getKey()
getKey
in interface KeyedValue
null
).public java.lang.Number getValue()
public void setValue(java.lang.Number value)
value
- the value (null
permitted).public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- Not thrown by this class, but
subclasses (if any) might.public java.lang.String toString()
toString
in class java.lang.Object