1 // CollationElementIterator.java - Iterate over decomposed characters.
3 /* Copyright (C) 1999 Red Hat, Inc.
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
14 * @author Tom Tromey <tromey@cygnus.com>
15 * @date March 25, 1999
17 /* Written using "Java Class Libraries", 2nd edition, plus online
18 * API docs for JDK 1.2 from http://www.javasoft.com.
19 * Status: Believed complete and correct to JDK 1.1.
22 public final class CollationElementIterator
24 public static final int NULLORDER = 0xffffffff;
28 if (index == text.length())
30 return collator.ceiNext(this);
33 // This one returns int while the others return short.
34 public static final int primaryOrder (int order)
36 // From the JDK 1.2 spec.
45 public static final short secondaryOrder (int order)
47 // From the JDK 1.2 spec.
48 return (order >>> 8) & 255;
51 public static final short tertiaryOrder (int order)
53 // From the JDK 1.2 spec.
57 // Non-public constructor.
58 CollationElementIterator (String text, RuleBasedCollator collator)
62 this.lookahead_set = false;
64 this.collator = collator;
67 // Text over which we iterate.
70 // Index of next character to examine in TEXT.
73 // A piece of lookahead.
74 boolean lookahead_set;
77 // The RuleBasedCollator which created this object.
78 RuleBasedCollator collator;