public class KeyValuePair extends java.lang.Object implements java.lang.Comparable<KeyValuePair>
There is nothing inherently key-like or value-like about the two elements, so this class could be used for any pair of strings.
(Lifted from PlanC.)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
KeyValuePair(java.lang.String key,
java.lang.String value)
Creates a new key-value pair with the indicated key and value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(KeyValuePair p)
Compares this key-value pair to another according to the natural sort order
of their components.
|
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
|
java.lang.String |
getKey()
Gets the pair's key.
|
java.lang.String |
getValue()
Gets the pair's value.
|
int |
hashCode()
Returns a hash code value for this key-value pair.
|
java.lang.String |
toString()
Gets a string representation of this key-value pair.
|
public static final java.lang.String ID
public KeyValuePair(java.lang.String key, java.lang.String value)
NullPointerException
will be
thrown.key
- the pair's key; may not be null.value
- the pair's value; may not be null.java.lang.NullPointerException
- if either the key or the value is null.public java.lang.String getKey()
public java.lang.String getValue()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to which this object is compared.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
org.uahirise.cassis.plan.util.KeyValuePair[key=KEY,value=VALUE]
toString
in class java.lang.Object
public int compareTo(KeyValuePair p)
compareTo
in interface java.lang.Comparable<KeyValuePair>
p
- another key-value pair to compare to this one.String.compareTo(String)
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona