public class DefaultKeyedValue extends java.lang.Object implements KeyedValue, java.lang.Cloneable, 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 KeyedValuenull).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.Objectobj - the object (null permitted).public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface PublicCloneableclone in class java.lang.Objectjava.lang.CloneNotSupportedException - Not thrown by this class, but
subclasses (if any) might.public java.lang.String toString()
toString in class java.lang.Object