Class Parser
Class Parser
java.lang.Object
|
+----Parser
- public class Parser
- extends Object
Parses and executes a sequence of tree operations represented as a
comma separated sequence of commands [iIdDlLP]<int> or
W where:
- I<int> indicates that this value should be inserted into
the structure;
- D<int> deletes this value from the structure;
- L<int> locates this value in the structure;
- R<int> rotate at node with this key;
- P<int> pauses the simulation for this many milliseconds;
- W pauses the simulation and resumes
when the display is static (wait)
- K toggles the display of keys/nodes
- + turns on the display of keys
- N toggles the use of inorder display ("neat")
- ! turns on the use of inorder display
- [ indicates that the current structure should be
saved for later recall
- ] recall a saved structure (can be called more
than once for the same saved configuration
- F the first time encountered, stores the current
- configuration; thereafter, restores this saved
configuration.
- *<int> insert this value into the tree without animating
the insertion. primarily for initializing a
configuration
- R repeat this entire sequence of instructions,
omitting the initial prefix of "*"-insertions.
By default, when in demo mode (parameter name=demoMode" with value="true")
nodes with values 2 are blue, 4 purple, 6 red and 8 orange; in this mode,
all others have the default color (initially set to gray).
-
endOp()
-
-
hasMoreOps()
- Returns true if there are additional operations to be
performed in the given operation sequence.
-
next()
- Parse and retrieve the next action to be performed; the
next operation is consumed
-
ready()
-
ready
public boolean ready()
endOp
public boolean endOp()
next
public Action next() throws IOException
- Parse and retrieve the next action to be performed; the
next operation is consumed
hasMoreOps
public boolean hasMoreOps()
- Returns true if there are additional operations to be
performed in the given operation sequence.