Android
java.text
public final class

java.text.CollationKey

java.lang.Object
java.text.CollationKey Comparable<T>

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.

Summary

Public Methods

          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
Methods inherited from interface java.lang.Comparable

Details

Public Methods

public int compareTo(CollationKey value)

Compare the receiver to the specified CollationKey to determine the relative ordering.

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

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.

Parameters

object the object to compare with this object

Returns

  • true if the specified object is equal to this CollationKey, false otherwise

See Also

public String getSourceString()

Answer the String from which this CollationKey was created.

Returns

  • a String

public int hashCode()

Returns an integer hash code for the receiver. Objects which are equal answer the same value for this method.

Returns

  • the receiver's hash

See Also

public byte[] toByteArray()

Answer the collation key as a byte array.

Returns

  • an array of bytes
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56