public class TernaryTree.Iterator extends Object implements Enumeration
Modifier and Type | Class and Description |
---|---|
private class |
TernaryTree.Iterator.Item |
Modifier and Type | Field and Description |
---|---|
(package private) int |
cur
current node index
|
(package private) String |
curkey
current key
|
(package private) StringBuffer |
ks
key stack implemented with a StringBuffer
|
(package private) Stack |
ns
Node stack
|
Constructor and Description |
---|
TernaryTree.Iterator() |
Modifier and Type | Method and Description |
---|---|
char |
getValue() |
boolean |
hasMoreElements() |
Object |
nextElement() |
void |
rewind() |
private int |
run()
traverse the tree to find next key
|
private int |
up()
traverse upwards
|
int cur
String curkey
Stack ns
StringBuffer ks
public void rewind()
public Object nextElement()
nextElement
in interface Enumeration
public char getValue()
public boolean hasMoreElements()
hasMoreElements
in interface Enumeration
private int up()
private int run()