CollationKeyNameCollationKeySynopsis
DescriptionThe CollationKey class optimizes the sorting of many strings. The easiest way to compare strings is using Collator.compare(), but this can be inefficient, especially if the same strings are compared many times. Instead, you can create a CollationKey for each of your strings and compare the CollationKey objects to each other using the compareTo() method. A CollationKey is essentially a bit representation of a String object. Two CollationKey objects can be compared bitwise, which allows for a fast comparison. You cannot create CollationKey objects directly; you must create them through a specific Collator object using Collator.getCollationKey(). You can only compare CollationKey objects that have been generated from the same Collator. Class Summary
public final class java.text.CollationKey extends java.lang.Object { // Instance Methods public int compareTo(CollationKey target); public boolean equals(Object target); public String getSourceString(); public int hashCode(); public byte[] toByteArray(); } Instance MethodscompareTopublic int compareTo(CollationKey target)
equalspublic boolean equals(Object target)
getSourceStringpublic String getSourceString()
hashCodepublic int hashCode()
toByteArraypublic byte[] toByteArray()
Inherited Methods
See AlsoCollator, RuleBasedCollator, String |
|