K - The class name of the key for this object.V - The class name of the value for this object.public class KeyValue<K,V> extends Object implements Cloneable, Comparable<KeyValue<K,V>>, Serializable
value. The
toString() method returns only value thus ensuring
that your display components function as normal, while giving
access to the unique identifier for control logic.
Copyright 2006 Sans Pareil Technologies, Inc.
| Constructor and Description |
|---|
KeyValue()
Default constructor.
|
KeyValue(K key,
V value)
Create a new instance using the specified values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInformation(K akey,
V avalue)
Add the specified
key-value pair to information |
Object |
clone()
Creates and returns a copy of this object.
|
int |
compareTo(KeyValue<K,V> object)
Compares this object with the specified object for order.
|
boolean |
equals(Object object)
Compare the specified object for equality with this object.
|
Map |
getInformation()
Returns
information. |
K |
getKey()
Returns
key. |
V |
getValue()
Returns
value. |
int |
hashCode()
Return a hash code for this object.
|
void |
setInformation(Map<K,V> information)
Set
information. |
void |
setKey(K key)
Set
key. |
void |
setValue(V value)
Set
value. |
String |
toString()
Returns a string representation of the object.
|
public KeyValue()
public Object clone() throws CloneNotSupportedException
Cloneable interface. No special actions are
performed. This method simply allows public access to the
Object.clone method.clone in class ObjectCloneNotSupportedException - If the super-class implementation
throws an error.public int compareTo(KeyValue<K,V> object)
Note: The default implementation compares the
value or key or hashCode() values in that
order depending upon whether they implement Comparable or
not.
compareTo in interface Comparable<KeyValue<K,V>>object - The object that is to be compared with this object.public boolean equals(Object object)
public int hashCode()
public String toString()
value.public Map getInformation()
information.public void setInformation(Map<K,V> information)
information.information - The value to set.public void addInformation(K akey, V avalue)
key-value pair to informationakey - The key for the mappingavalue - The value for the mapping.