86 * You can set a <code>Collator</code>'s <em>strength</em> property |
86 * You can set a <code>Collator</code>'s <em>strength</em> property |
87 * to determine the level of difference considered significant in |
87 * to determine the level of difference considered significant in |
88 * comparisons. Four strengths are provided: <code>PRIMARY</code>, |
88 * comparisons. Four strengths are provided: <code>PRIMARY</code>, |
89 * <code>SECONDARY</code>, <code>TERTIARY</code>, and <code>IDENTICAL</code>. |
89 * <code>SECONDARY</code>, <code>TERTIARY</code>, and <code>IDENTICAL</code>. |
90 * The exact assignment of strengths to language features is |
90 * The exact assignment of strengths to language features is |
91 * locale dependant. For example, in Czech, "e" and "f" are considered |
91 * locale dependent. For example, in Czech, "e" and "f" are considered |
92 * primary differences, while "e" and "ě" are secondary differences, |
92 * primary differences, while "e" and "ě" are secondary differences, |
93 * "e" and "E" are tertiary differences and "e" and "e" are identical. |
93 * "e" and "E" are tertiary differences and "e" and "e" are identical. |
94 * The following shows how both case and accents could be ignored for |
94 * The following shows how both case and accents could be ignored for |
95 * US English. |
95 * US English. |
96 * <blockquote> |
96 * <blockquote> |
130 implements java.util.Comparator<Object>, Cloneable |
130 implements java.util.Comparator<Object>, Cloneable |
131 { |
131 { |
132 /** |
132 /** |
133 * Collator strength value. When set, only PRIMARY differences are |
133 * Collator strength value. When set, only PRIMARY differences are |
134 * considered significant during comparison. The assignment of strengths |
134 * considered significant during comparison. The assignment of strengths |
135 * to language features is locale dependant. A common example is for |
135 * to language features is locale dependent. A common example is for |
136 * different base letters ("a" vs "b") to be considered a PRIMARY difference. |
136 * different base letters ("a" vs "b") to be considered a PRIMARY difference. |
137 * @see java.text.Collator#setStrength |
137 * @see java.text.Collator#setStrength |
138 * @see java.text.Collator#getStrength |
138 * @see java.text.Collator#getStrength |
139 */ |
139 */ |
140 public static final int PRIMARY = 0; |
140 public static final int PRIMARY = 0; |
141 /** |
141 /** |
142 * Collator strength value. When set, only SECONDARY and above differences are |
142 * Collator strength value. When set, only SECONDARY and above differences are |
143 * considered significant during comparison. The assignment of strengths |
143 * considered significant during comparison. The assignment of strengths |
144 * to language features is locale dependant. A common example is for |
144 * to language features is locale dependent. A common example is for |
145 * different accented forms of the same base letter ("a" vs "\u00E4") to be |
145 * different accented forms of the same base letter ("a" vs "\u00E4") to be |
146 * considered a SECONDARY difference. |
146 * considered a SECONDARY difference. |
147 * @see java.text.Collator#setStrength |
147 * @see java.text.Collator#setStrength |
148 * @see java.text.Collator#getStrength |
148 * @see java.text.Collator#getStrength |
149 */ |
149 */ |
150 public static final int SECONDARY = 1; |
150 public static final int SECONDARY = 1; |
151 /** |
151 /** |
152 * Collator strength value. When set, only TERTIARY and above differences are |
152 * Collator strength value. When set, only TERTIARY and above differences are |
153 * considered significant during comparison. The assignment of strengths |
153 * considered significant during comparison. The assignment of strengths |
154 * to language features is locale dependant. A common example is for |
154 * to language features is locale dependent. A common example is for |
155 * case differences ("a" vs "A") to be considered a TERTIARY difference. |
155 * case differences ("a" vs "A") to be considered a TERTIARY difference. |
156 * @see java.text.Collator#setStrength |
156 * @see java.text.Collator#setStrength |
157 * @see java.text.Collator#getStrength |
157 * @see java.text.Collator#getStrength |
158 */ |
158 */ |
159 public static final int TERTIARY = 2; |
159 public static final int TERTIARY = 2; |
160 |
160 |
161 /** |
161 /** |
162 * Collator strength value. When set, all differences are |
162 * Collator strength value. When set, all differences are |
163 * considered significant during comparison. The assignment of strengths |
163 * considered significant during comparison. The assignment of strengths |
164 * to language features is locale dependant. A common example is for control |
164 * to language features is locale dependent. A common example is for control |
165 * characters ("\u0001" vs "\u0002") to be considered equal at the |
165 * characters ("\u0001" vs "\u0002") to be considered equal at the |
166 * PRIMARY, SECONDARY, and TERTIARY levels but different at the IDENTICAL |
166 * PRIMARY, SECONDARY, and TERTIARY levels but different at the IDENTICAL |
167 * level. Additionally, differences between pre-composed accents such as |
167 * level. Additionally, differences between pre-composed accents such as |
168 * "\u00C0" (A-grave) and combining accents such as "A\u0300" |
168 * "\u00C0" (A-grave) and combining accents such as "A\u0300" |
169 * (A, combining-grave) will be considered significant at the IDENTICAL |
169 * (A, combining-grave) will be considered significant at the IDENTICAL |