com.ibm.commerce.tools.util
Class StringPair
- java.lang.Object
-
- com.ibm.commerce.tools.util.StringPair
-
- All Implemented Interfaces:
- java.lang.Comparable
public class StringPair extends java.lang.Object implements java.lang.Comparable
A basic string key or value pair wrapper used for sorting.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
The IBM copyright notice field.
-
Constructor Summary
Constructors Constructor and Description 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)
Deprecated.This constructor is replaced by StringPair(java.lang.String,java.lang.String,com.ibm.icu.text.Collator) for the same purpose. This constructor takes in a key or value pair and a collator.StringPair(java.lang.String k, java.lang.String v, com.ibm.icu.text.Collator c)
This constructor takes in a key or value pair and a collator.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description int
compareTo(java.lang.Object o)
Compares with another StringPair's value.java.text.Collator
getCollator()
Deprecated.This method is replaced by method getICUCollator() for the same purpose. Gets the collatorcom.ibm.icu.text.Collator
getICUCollator()
Gets the collatorjava.lang.String
getKey()
Returns the key.java.lang.String
getValue()
Returns the value.void
setCollator(java.text.Collator c)
Deprecated.This method is replaced by method setICUCollator(com.ibm.icu.text.Collator) for the same purpose. Sets the collatorvoid
setICUCollator(com.ibm.icu.text.Collator c)
Sets the collatorvoid
setKey(java.lang.String k)
Sets the key.void
setValue(java.lang.String v)
Sets the value.
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
The IBM copyright notice field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StringPair
public StringPair(java.lang.String k, java.lang.String v)
This constructor takes in a key or value pair.- Parameters:
k
- the keyv
- the value
-
StringPair
public StringPair(java.lang.String k, java.lang.String v, java.text.Collator c)
Deprecated. This constructor is replaced by StringPair(java.lang.String,java.lang.String,com.ibm.icu.text.Collator) for the same purpose. This constructor takes in a key or value pair and a collator.- Parameters:
k
- the keyv
- the valuec
- the collator
-
StringPair
public StringPair(java.lang.String k, java.lang.String v, com.ibm.icu.text.Collator c)
This constructor takes in a key or value pair and a collator.- Parameters:
k
- the keyv
- the valuec
- the collator
-
-
Method Detail
-
getKey
public java.lang.String getKey()
Returns the key.- Returns:
- the key
-
setKey
public void setKey(java.lang.String k)
Sets the key.- Parameters:
k
- the key
-
getValue
public java.lang.String getValue()
Returns the value.- Returns:
- the value
-
setValue
public void setValue(java.lang.String v)
Sets the value.- Parameters:
v
- the value
-
compareTo
public int compareTo(java.lang.Object o)
Compares with another StringPair's value.- Specified by:
compareTo
in interfacejava.lang.Comparable
- Parameters:
o
-StringPair
object to be compared- Returns:
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
-
getCollator
public java.text.Collator getCollator()
Deprecated. This method is replaced by method getICUCollator() for the same purpose. Gets the collator- Returns:
- the Collator
-
getICUCollator
public com.ibm.icu.text.Collator getICUCollator()
Gets the collator- Returns:
- the Collator
-
setCollator
public void setCollator(java.text.Collator c)
Deprecated. This method is replaced by method setICUCollator(com.ibm.icu.text.Collator) for the same purpose. Sets the collator- Parameters:
c
- the collator
-
setICUCollator
public void setICUCollator(com.ibm.icu.text.Collator c)
Sets the collator- Parameters:
c
- the collator
-
-