< prev index next >

src/java.base/share/classes/java/text/Collator.java

Print this page




 106  * <p>
 107  * For comparing <code>String</code>s exactly once, the <code>compare</code>
 108  * method provides the best performance. When sorting a list of
 109  * <code>String</code>s however, it is generally necessary to compare each
 110  * <code>String</code> multiple times. In this case, <code>CollationKey</code>s
 111  * provide better performance. The <code>CollationKey</code> class converts
 112  * a <code>String</code> to a series of bits that can be compared bitwise
 113  * against other <code>CollationKey</code>s. A <code>CollationKey</code> is
 114  * created by a <code>Collator</code> object for a given <code>String</code>.
 115  * <br>
 116  * <strong>Note:</strong> <code>CollationKey</code>s from different
 117  * <code>Collator</code>s can not be compared. See the class description
 118  * for {@link CollationKey}
 119  * for an example using <code>CollationKey</code>s.
 120  *
 121  * @see         RuleBasedCollator
 122  * @see         CollationKey
 123  * @see         CollationElementIterator
 124  * @see         Locale
 125  * @author      Helena Shih, Laura Werner, Richard Gillam

 126  */
 127 
 128 public abstract class Collator
 129     implements java.util.Comparator<Object>, Cloneable
 130 {
 131     /**
 132      * Collator strength value.  When set, only PRIMARY differences are
 133      * considered significant during comparison. The assignment of strengths
 134      * to language features is locale dependant. A common example is for
 135      * different base letters ("a" vs "b") to be considered a PRIMARY difference.
 136      * @see java.text.Collator#setStrength
 137      * @see java.text.Collator#getStrength
 138      */
 139     public static final int PRIMARY = 0;
 140     /**
 141      * Collator strength value.  When set, only SECONDARY and above differences are
 142      * considered significant during comparison. The assignment of strengths
 143      * to language features is locale dependant. A common example is for
 144      * different accented forms of the same base letter ("a" vs "\u00E4") to be
 145      * considered a SECONDARY difference.




 106  * <p>
 107  * For comparing <code>String</code>s exactly once, the <code>compare</code>
 108  * method provides the best performance. When sorting a list of
 109  * <code>String</code>s however, it is generally necessary to compare each
 110  * <code>String</code> multiple times. In this case, <code>CollationKey</code>s
 111  * provide better performance. The <code>CollationKey</code> class converts
 112  * a <code>String</code> to a series of bits that can be compared bitwise
 113  * against other <code>CollationKey</code>s. A <code>CollationKey</code> is
 114  * created by a <code>Collator</code> object for a given <code>String</code>.
 115  * <br>
 116  * <strong>Note:</strong> <code>CollationKey</code>s from different
 117  * <code>Collator</code>s can not be compared. See the class description
 118  * for {@link CollationKey}
 119  * for an example using <code>CollationKey</code>s.
 120  *
 121  * @see         RuleBasedCollator
 122  * @see         CollationKey
 123  * @see         CollationElementIterator
 124  * @see         Locale
 125  * @author      Helena Shih, Laura Werner, Richard Gillam
 126  * @since 1.1
 127  */
 128 
 129 public abstract class Collator
 130     implements java.util.Comparator<Object>, Cloneable
 131 {
 132     /**
 133      * Collator strength value.  When set, only PRIMARY differences are
 134      * considered significant during comparison. The assignment of strengths
 135      * to language features is locale dependant. A common example is for
 136      * different base letters ("a" vs "b") to be considered a PRIMARY difference.
 137      * @see java.text.Collator#setStrength
 138      * @see java.text.Collator#getStrength
 139      */
 140     public static final int PRIMARY = 0;
 141     /**
 142      * Collator strength value.  When set, only SECONDARY and above differences are
 143      * considered significant during comparison. The assignment of strengths
 144      * to language features is locale dependant. A common example is for
 145      * different accented forms of the same base letter ("a" vs "\u00E4") to be
 146      * considered a SECONDARY difference.


< prev index next >