/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */

package java.text;

import kaffe.util.NotImplemented;

public final class CollationElementIterator {

public final static int NULLORDER = 0xffffffff;

private CollationElementIterator() {}
    
public int next() {
	throw new NotImplemented(CollationElementIterator.class.getName() + ".next()");
}

public void reset() {
	throw new NotImplemented(CollationElementIterator.class.getName() + ".reset()");
}

public final static int primaryOrder(int order) {
	throw new NotImplemented(CollationElementIterator.class.getName() + ".primaryOrder(int)");
}

public final static short secondaryOrder(int order) {
	throw new NotImplemented(CollationElementIterator.class.getName() + ".secondaryOrder(int)");
}

public final static short tertiaryOrder(int order) {
	throw new NotImplemented(CollationElementIterator.class.getName() + ".tertiaryOrder(int)");
}

}

@@ -1,8 +1,9 @@
+%0A
 /*%0A * Ja
@@ -56,24 +56,77 @@
  199
-7, 1998%0A *      
+9%0A *%09Archie L. Cobbs.  All rights reserved.%0A * Copyright (c) 1999%0A *%09
 Tran
@@ -277,63 +277,79 @@
 .%0A *
-/%0A%0Apackage java.text;%0A%0Aimport kaffe.util.NotImplemented
+%0A * Author: Archie L. Cobbs %3Carchie@whistle.com%3E%0A */%0A%0Apackage java.text
 ;%0A%0Ap
@@ -393,17 +393,17 @@
 rator %7B%0A
-%0A
+%09
 public f
@@ -442,17 +442,17 @@
 ffffff;%0A
-%0A
+%09
 private 
@@ -456,253 +456,507 @@
 te C
-ollationElementIterator() %7B%7D%0A    %0Apublic int next() %7B%0A%09throw new NotImplemented(CollationElementIterator.class.getName() + %22.next()%22
+haracterIterator src;%0A%0A%09CollationElementIterator(String str) %7B%0A%09%09src = new StringCharacterIterator(str);%0A%09%7D%0A%0A%09CollationElementIterator(CharacterIterator src) %7B%0A%09%09this.src = src;%0A%09%7D%0A%0A%09public void reset() %7B%0A%09%09src.setIndex(0
 );%0A
+%09
 %7D%0A
-%0A
+   %0A%09
 public 
-void reset() %7B%0A%09throw new NotImplemented(CollationElementIterator.class.getName() + %22.reset()%22)
+int next() %7B%0A%09%09char c = src.next();%0A%09%09if (c == CharacterIterator.DONE) %7B%0A%09%09%09return NULLORDER;%0A%09%09%7D%0A%09%09return c %3C%3C 16;%0A%09%7D%0A   %0A%09public int previous() %7B%0A%09%09char c = src.previous();%0A%09%09if (c == CharacterIterator.DONE) %7B%0A%09%09%09return NULLORDER;%0A%09%09%7D%0A%09%09return c %3C%3C 16
 ;%0A
+%09
 %7D%0A%0A
+%09
 publ
@@ -1006,102 +1006,132 @@
  %7B%0A%09
-throw new NotImplemented(CollationElementIterator.class.getName() + %22.primaryOrder(int)%22
+%09return order %3E%3E 16;%0A%09%7D%0A%0A%09public final static short secondaryOrder(int order) %7B%0A%09%09return (short)((order %3E%3E 8) & 0xff
 );%0A
+%09
 %7D%0A%0A
+%09
 publ
@@ -1144,38 +1144,37 @@
 al static short 
-second
+terti
 aryOrder(int ord
@@ -1184,250 +1184,383 @@
  %7B%0A%09
-throw new NotImplemented(CollationElementIterator.class.getName() + %22.secondaryOrder(int)%22
+%09return (short)(order & 0xff);%0A%09%7D%0A%0A%09public void setOffset(int newOffset) %7B%0A%09%09src.setIndex(newOffset
 );%0A
+%09
 %7D%0A%0A
+%09
 public 
-f
 in
-al static short tertiaryOrder(int order) %7B%0A%09throw new NotImplemented(CollationElementIterator.class.getName() + %22.tertiaryOrder(int)%22)
+t getOffset() %7B%0A%09%09return src.getIndex();%0A%09%7D%0A%0A%09public int getMaxExpansion(int order) %7B%0A%09%09return 1;%09// XXX ??%0A%09%7D%0A%0A%09public void setText(String str) %7B%0A%09%09src = new StringCharacterIterator(str);%0A%09%7D%0A%0A%09public void setText(CharacterIterator source) %7B%0A%09%09src = source
 ;%0A
+%09
 %7D%0A%0A%7D

Implement this class (mostly).