|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttextmaven.tst.TSTIterator
Read only iterator for TST.
| Field Summary | |
protected static int[] |
REL_TO_STATE
Conversion array from node relative constants to states. |
protected static int[] |
STATE_TO_REL
Converstion from states to node relative constants. |
static int |
STATE0_LO
Inspect child with lower key next |
static int |
STATE1_NODE
Inspect current node next |
static int |
STATE2_EQ
Inspect child with equal, but longer key next |
static int |
STATE3_HI
Inspect child with higher key next |
static int |
STATE4_DONE
Move back to parent |
| Constructor Summary | |
TSTIterator(textmaven.tst.TSTNode root)
Constructs an iterator traversing the tree with the given root node. |
|
| Method Summary | |
protected void |
calculateNext(int state)
Starts looking for a plausible next node at the current node with the given state. |
boolean |
hasNext()
|
java.lang.Object |
next()
|
TSTEntry |
nextEntry()
As next, but with the concrete rather than the abstract return type. |
void |
remove()
NOT SUPPORTED! |
protected boolean |
visitNode(textmaven.tst.TSTNode node)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int STATE0_LO
public static final int STATE1_NODE
public static final int STATE2_EQ
public static final int STATE3_HI
public static final int STATE4_DONE
protected static final int[] REL_TO_STATE
protected static final int[] STATE_TO_REL
| Constructor Detail |
public TSTIterator(textmaven.tst.TSTNode root)
root - the root of the traversed sub tree (not tested for anything
but the root node)| Method Detail |
public void remove()
remove in interface java.util.Iteratorprotected boolean visitNode(textmaven.tst.TSTNode node)
protected void calculateNext(int state)
nextNode instance variable.
If nextNode != null nothing is done.
STATE0_LO,
STATE1_NODE,
STATE2_EQ,
STATE3_HI,
STATE4_DONEpublic boolean hasNext()
hasNext in interface java.util.IteratorIterator.hasNext()public java.lang.Object next()
next in interface java.util.IteratorIterator.next()public TSTEntry nextEntry()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||