/[classpath]/classpath/java/text/RuleBasedCollator.java
ViewVC logotype

Diff of /classpath/java/text/RuleBasedCollator.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mkoch, Wed Apr 30 12:34:37 2003 UTC revision 1.8 by mkoch, Thu May 15 13:17:44 2003 UTC
# Line 1  Line 1 
1  /* RuleBasedCollator.java -- Concrete Collator Class  /* RuleBasedCollator.java -- Concrete Collator Class
2     Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2000, 2001, 2003  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 40  package java.text; Line 40  package java.text;
40    
41  import java.util.Vector;  import java.util.Vector;
42    
43    /* Written using "Java Class Libraries", 2nd edition, plus online
44     * API docs for JDK 1.2 from http://www.javasoft.com.
45     * Status: Believed complete and correct
46     */
47    
48  /**  /**
49   * This class is a concrete subclass of <code>Collator</code> suitable   * This class is a concrete subclass of <code>Collator</code> suitable
50   * for string collation in a wide variety of languages.  An instance of   * for string collation in a wide variety of languages.  An instance of
# Line 51  import java.util.Vector; Line 56  import java.util.Vector;
56   * Rules take the form of a <code>String</code> with the following syntax   * Rules take the form of a <code>String</code> with the following syntax
57   * <ul>   * <ul>
58   * <li> Modifier: '@'   * <li> Modifier: '@'
59   * <li> Relation: '<' | ';' | ',' | '=' : <text>   * <li> Relation: '&lt;' | ';' | ',' | '=' : <text>
60   * <li> Reset: '&' : <text>   * <li> Reset: '&amp;' : <text>
61   * </ul>   * </ul>
62   * The modifier character indicates that accents sort backward as is the   * The modifier character indicates that accents sort backward as is the
63   * case with French.  The relational operators specify how the text   * case with French.  The relational operators specify how the text
64   * argument relates to the previous term.  The relation characters have   * argument relates to the previous term.  The relation characters have
65   * the following meanings:   * the following meanings:
66   * <ul>   * <ul>
67   * <li>'<' - The text argument is greater than the prior term at the primary   * <li>'&lt;' - The text argument is greater than the prior term at the primary
68   * difference level.   * difference level.
69   * <li>';' - The text argument is greater than the prior term at the secondary   * <li>';' - The text argument is greater than the prior term at the secondary
70   * difference level.   * difference level.
# Line 89  import java.util.Vector; Line 94  import java.util.Vector;
94   * <p>   * <p>
95   * Here are a couple of example of rule strings:   * Here are a couple of example of rule strings:
96   * <p>   * <p>
97   * "< a < b < c" - This string says that a is greater than b which is   * "&lt; a &lt; b &lt; c" - This string says that a is greater than b which is
98   * greater than c, with all differences being primary differences.   * greater than c, with all differences being primary differences.
99   * <p>   * <p>
100   * "< a,A < b,B < c,C" - This string says that 'A' is greater than 'a' with   * "&lt; a,A &lt; b,B &lt; c,C" - This string says that 'A' is greater than 'a' with
101   * a tertiary strength comparison.  Both 'b' and 'B' are greater than 'a' and   * a tertiary strength comparison.  Both 'b' and 'B' are greater than 'a' and
102   * 'A' during a primary strength comparison.  But 'B' is greater than 'b'   * 'A' during a primary strength comparison.  But 'B' is greater than 'b'
103   * under a tertiary strength comparison.   * under a tertiary strength comparison.
104   * <p>   * <p>
105   * "< a < c & a < b " - This sequence is identical in function to the   * "&lt; a &lt; c &amp; a &lt; b " - This sequence is identical in function to the
106   * "< a < b < c" rule string above.  The '&' reset symbol indicates that   * "&lt; a &lt; b &lt; c" rule string above.  The '&amp;' reset symbol indicates that
107   * the rule "< b" is to be inserted after the text argument "a" in the   * the rule "&lt; b" is to be inserted after the text argument "a" in the
108   * previous rule string segment.   * previous rule string segment.
109   * <p>   * <p>
110   * "< a < b & y < z" - This is an error.  The character 'y' does not appear   * "&lt; a &lt; b &amp; y &lt; z" - This is an error.  The character 'y' does not appear
111   * anywhere in the previous rule string segment so the rule following the   * anywhere in the previous rule string segment so the rule following the
112   * reset rule cannot be inserted.   * reset rule cannot be inserted.
113   * <p>   * <p>
# Line 112  import java.util.Vector; Line 117  import java.util.Vector;
117   * As an additional complication to this already overly complex rule scheme,   * As an additional complication to this already overly complex rule scheme,
118   * if any characters precede the first rule, these characters are considered   * if any characters precede the first rule, these characters are considered
119   * ignorable.  They will be treated as if they did not exist during   * ignorable.  They will be treated as if they did not exist during
120   * comparisons.  For example, "- < a < b ..." would make '-' an ignorable   * comparisons.  For example, "- &lt; a &lt; b ..." would make '-' an ignorable
121   * character such that the strings "high-tech" and "hightech" would   * character such that the strings "high-tech" and "hightech" would
122   * be considered identical.   * be considered identical.
123   * <p>   * <p>
# Line 125  import java.util.Vector; Line 130  import java.util.Vector;
130   * the previous rule string section.   * the previous rule string section.
131   * </ul>   * </ul>
132   *   *
133   * @author Aaron M. Renn (arenn@urbanophile.com)   * @author Aaron M. Renn <arenn@urbanophile.com>
134     * @author Tom Tromey <tromey@cygnus.com>
135     * @date March 25, 1999
136   */   */
137  public class RuleBasedCollator extends Collator  public class RuleBasedCollator extends Collator
138  {  {

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26