java.lang.Object | +--com.ibm.commerce.tools.util.StringPair
A basic string key or value pair wrapper used for sorting.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM copyright notice field. |
Constructor Summary | |
---|---|
StringPair(java.lang.String k, java.lang.String v) This constructor takes in a key or value pair. | |
StringPair(java.lang.String k, java.lang.String v,
java.text.Collator c) This constructor takes in a key or value pair and a collator. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o) Compares with another StringPair's value. |
java.text.Collator |
getCollator() Gets the collator |
java.lang.String |
getKey() Returns the key. |
java.lang.String |
getValue() Returns the value. |
void |
setCollator(java.text.Collator collator) Sets the collator |
void |
setKey(java.lang.String key) Sets the key |
void |
setValue(java.lang.String value) Sets the value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public StringPair(java.lang.String k, java.lang.String v)
k
- The key.v
- The value.public StringPair(java.lang.String k, java.lang.String v, java.text.Collator c)
k
- the keyv
- the valuec
- the collatorMethod Detail |
---|
public java.lang.String getKey()
public void setKey(java.lang.String key)
key
- the key.public java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the value.public int compareTo(java.lang.Object o)
compareTo
in interface
java.lang.Comparable
o
- StringPair object to be compared.0
if the objects are equal, or an exception is thrown.-1
if this value is less than the object's value.1
if this value is greater than the object's
value.public java.text.Collator getCollator()
public void setCollator(java.text.Collator collator)
collator
- the collator.