remove extraneous code checked in with previous delta
[official-gcc.git] / libjava / java / text / CollationElementIterator.java
blob96732f7b2e339e8afd48c90f636f9b9d02b2e881
1 // CollationElementIterator.java - Iterate over decomposed characters.
3 /* Copyright (C) 1999 Free Software Foundation
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
9 details. */
11 package java.text;
13 /**
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;
26 public int next ()
28 if (index == text.length())
29 return NULLORDER;
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.
37 return order >>> 16;
40 public void reset ()
42 index = 0;
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.
54 return order & 255;
57 // Non-public constructor.
58 CollationElementIterator (String text, RuleBasedCollator collator)
60 this.text = text;
61 this.index = 0;
62 this.lookahead_set = false;
63 this.lookahead = 0;
64 this.collator = collator;
67 // Text over which we iterate.
68 String text;
70 // Index of next character to examine in TEXT.
71 int index;
73 // A piece of lookahead.
74 boolean lookahead_set;
75 int lookahead;
77 // The RuleBasedCollator which created this object.
78 RuleBasedCollator collator;