/[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.15 by mkoch, Mon Oct 20 13:54:53 2003 UTC revision 1.16 by mkoch, Mon Oct 20 14:47:00 2003 UTC
# Line 177  public class RuleBasedCollator extends C Line 177  public class RuleBasedCollator extends C
177    public RuleBasedCollator (String rules) throws ParseException    public RuleBasedCollator (String rules) throws ParseException
178    {    {
179      if (rules.equals (""))      if (rules.equals (""))
180        throw new ParseException ("empty rule set", 0);        throw new IllegalArgumentException ("Empty rule set");
181            
182      this.rules = rules;      this.rules = rules;
183      Vector vec = new Vector();      Vector vec = new Vector();
# Line 196  public class RuleBasedCollator extends C Line 196  public class RuleBasedCollator extends C
196          if (Character.isWhitespace (c))          if (Character.isWhitespace (c))
197            continue;            continue;
198    
199          // Primary difference.          // Primary difference
200          if (c == '<')          if (c == '<')
201            {            {
202              ignore_chars = false;              ignore_chars = false;
# Line 212  public class RuleBasedCollator extends C Line 212  public class RuleBasedCollator extends C
212              continue;              continue;
213            }            }
214    
215          // Secondary difference.          // Secondary difference
216          if (c == ';')          if (c == ';')
217            {            {
218              if (primary_seq == 0)              if (primary_seq == 0)
# Line 229  public class RuleBasedCollator extends C Line 229  public class RuleBasedCollator extends C
229              continue;              continue;
230            }            }
231    
232          // Tertiary difference.          // Tertiary difference
233          if (c == ',')          if (c == ',')
234            {            {
235              if (primary_seq == 0)              if (primary_seq == 0)
236                throw new ParseException (rules, index);                throw new ParseException (rules, index);
237    
238              CollationElement e = new CollationElement (argument.toString(),              CollationElement e = new CollationElement (argument.toString(), primary_seq,
                                                        primary_seq,  
239                                                         secondary_seq,                                                         secondary_seq,
240                                                         tertiary_seq);                                                         tertiary_seq);
241              ++tertiary_seq;              ++tertiary_seq;
# Line 246  public class RuleBasedCollator extends C Line 245  public class RuleBasedCollator extends C
245              continue;              continue;
246            }            }
247    
248          // Is equal to.          // Is equal to
249          if (c == '=')          if (c == '=')
250            {            {
251              if (primary_seq == 0)              if (primary_seq == 0)
252                throw new ParseException (rules, index);                throw new ParseException (rules, index);
253    
254              CollationElement e = new CollationElement (argument.toString(),              CollationElement e = new CollationElement (argument.toString(), primary_seq,
                                                        primary_seq,  
255                                                         secondary_seq,                                                         secondary_seq,
256                                                         tertiary_seq);                                                         tertiary_seq);
257              vec.add (e);              vec.add (e);
# Line 261  public class RuleBasedCollator extends C Line 259  public class RuleBasedCollator extends C
259              continue;              continue;
260            }            }
261    
262          // Sort accents backwards.          // Sort accents backwards
263          if (c == '@')          if (c == '@')
264            {            {
265              throw new ParseException ("French style accents not implemented yet", 0);              throw new ParseException("French style accents not implemented yet", 0);
266            }            }
267    
268          // Reset command.          // Reset command
269          if (c == '&')          if (c == '&')
270            {            {
271              throw new ParseException ("Reset not implemented yet", 0);              throw new ParseException("Reset not implemented yet", 0);
272            }            }
273    
274          // See if we are still reading characters to skip.          // See if we are still reading characters to skip
275          if (ignore_chars == true)          if (ignore_chars == true)
276            {            {
277              CollationElement e = new CollationElement (c + "", 0, (short) 0,              CollationElement e = new CollationElement (c + "", 0, (short)0,
278                                                         (short) 0);                                                         (short)0);
279              vec.add (e);              vec.add(e);
280              continue;              continue;
281            }            }
282    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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