Build 1.0_r1(from source)

java.text
Class CollationKey

java.lang.Object
  extended by java.text.CollationKey
All Implemented Interfaces:
Comparable<CollationKey>

public final class CollationKey
extends Object
implements Comparable<CollationKey>

CollationKey represents the collation order of a particular String for a specific Collator. CollationKeys can be compared to determine the relative ordering of their source Strings. This is useful when the Strings must be compared multiple times, as in sorting.


Constructor Summary
CollationKey(String source, com.ibm.icu4jni.text.CollationKey key)
           
 
Method Summary
 int compareTo(CollationKey value)
          Compare the receiver to the specified CollationKey to determine the relative ordering.
 boolean equals(Object object)
          Compares the specified object to this CollationKey and answer if they are equal.
 String getSourceString()
          Answer the String from which this CollationKey was created.
 int hashCode()
          Returns an integer hash code for the receiver.
 byte[] toByteArray()
          Answer the collation key as a byte array.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollationKey

CollationKey(String source,
             com.ibm.icu4jni.text.CollationKey key)
Method Detail

compareTo

public int compareTo(CollationKey value)
Compare the receiver to the specified CollationKey to determine the relative ordering.

Specified by:
compareTo in interface Comparable<CollationKey>
Parameters:
value - a CollationKey
Returns:
an int < 0="" if="" this="" collationkey="" is="" less="" than="" the="" specified="" collationkey,="" 0="" if="" they="" are="" equal,="" and=""> 0 if this CollationKey is greater

equals

public boolean equals(Object object)
Compares the specified object to this CollationKey and answer if they are equal. The object must be an instance of CollationKey and have the same source string and collation key. The instances of CollationKey must have been created by the same Collator.

Overrides:
equals in class Object
Parameters:
object - the object to compare with this object
Returns:
true if the specified object is equal to this CollationKey, false otherwise
See Also:
hashCode()

getSourceString

public String getSourceString()
Answer the String from which this CollationKey was created.

Returns:
a String

hashCode

public int hashCode()
Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Overrides:
hashCode in class Object
Returns:
the receiver's hash
See Also:
equals(java.lang.Object)

toByteArray

public byte[] toByteArray()
Answer the collation key as a byte array.

Returns:
an array of bytes

Build 1.0_r1(from source)

Please submit a feedback, bug or feature