加载中...
The Wayback Machine - https://sup1a9wrlpyh5li9ro.vcoronado.top/web/20090226225735/http://developer.android.com:80/reference/java/text/CollationKey.html
public final class

CollationKey

extends Object
implements Comparable<T>
java.lang.Object
   ↳ java.text.CollationKey

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Comparable

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