equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
271 * RuleBasedCollator constructor. This takes the table rules and builds |
271 * RuleBasedCollator constructor. This takes the table rules and builds |
272 * a collation table out of them. Please see RuleBasedCollator class |
272 * a collation table out of them. Please see RuleBasedCollator class |
273 * description for more details on the collation rule syntax. |
273 * description for more details on the collation rule syntax. |
274 * @see java.util.Locale |
274 * @see java.util.Locale |
275 * @param rules the collation rules to build the collation table from. |
275 * @param rules the collation rules to build the collation table from. |
276 * @exception ParseException A format exception |
276 * @throws ParseException A format exception |
277 * will be thrown if the build process of the rules fails. For |
277 * will be thrown if the build process of the rules fails. For |
278 * example, build rule "a < ? < d" will cause the constructor to |
278 * example, build rule "a < ? < d" will cause the constructor to |
279 * throw the ParseException because the '?' is not quoted. |
279 * throw the ParseException because the '?' is not quoted. |
280 */ |
280 */ |
281 public RuleBasedCollator(String rules) throws ParseException { |
281 public RuleBasedCollator(String rules) throws ParseException { |
288 * description for more details on the collation rule syntax. |
288 * description for more details on the collation rule syntax. |
289 * @see java.util.Locale |
289 * @see java.util.Locale |
290 * @param rules the collation rules to build the collation table from. |
290 * @param rules the collation rules to build the collation table from. |
291 * @param decomp the decomposition strength used to build the |
291 * @param decomp the decomposition strength used to build the |
292 * collation table and to perform comparisons. |
292 * collation table and to perform comparisons. |
293 * @exception ParseException A format exception |
293 * @throws ParseException A format exception |
294 * will be thrown if the build process of the rules fails. For |
294 * will be thrown if the build process of the rules fails. For |
295 * example, build rule "a < ? < d" will cause the constructor to |
295 * example, build rule "a < ? < d" will cause the constructor to |
296 * throw the ParseException because the '?' is not quoted. |
296 * throw the ParseException because the '?' is not quoted. |
297 */ |
297 */ |
298 RuleBasedCollator(String rules, int decomp) throws ParseException { |
298 RuleBasedCollator(String rules, int decomp) throws ParseException { |
348 * Compares the character data stored in two different strings based on the |
348 * Compares the character data stored in two different strings based on the |
349 * collation rules. Returns information about whether a string is less |
349 * collation rules. Returns information about whether a string is less |
350 * than, greater than or equal to another string in a language. |
350 * than, greater than or equal to another string in a language. |
351 * This can be overridden in a subclass. |
351 * This can be overridden in a subclass. |
352 * |
352 * |
353 * @exception NullPointerException if <code>source</code> or <code>target</code> is null. |
353 * @throws NullPointerException if <code>source</code> or <code>target</code> is null. |
354 */ |
354 */ |
355 public synchronized int compare(String source, String target) |
355 public synchronized int compare(String source, String target) |
356 { |
356 { |
357 if (source == null || target == null) { |
357 if (source == null || target == null) { |
358 throw new NullPointerException(); |
358 throw new NullPointerException(); |