org.grinvin.conjecture.engine.apengine
Class TreeGenerator.TreeGeneratorStateStack
- TreeGenerator<T,extends,BinaryTree>
protected static class TreeGenerator.TreeGeneratorStateStack
Private class to represent the stack of the
TreeGenerator
. Handling this
manually improves computation speed.
org.grinvin.conjecture.engine.apengine.TreeGenerator.TreeGeneratorState[] | createArray(int size)
|
org.grinvin.conjecture.engine.apengine.TreeGenerator.TreeGeneratorState | emptyState()
|
void | pushNewDepthState(int unaryCount, int binaryCount) - Push a new state that upon execution will start working with new unary and binary count.
|
void | pushRecurseState(int depth, int pos, int endpos)
|
void | pushRemoveState(int depth, int leftrightpos, int parent) - Push a new state that upon execution will remove the node with the given coordinates.
|
createArray
public org.grinvin.conjecture.engine.apengine.TreeGenerator.TreeGeneratorState[] createArray(int size)
- createArray in interface StateStack<E>
emptyState
public org.grinvin.conjecture.engine.apengine.TreeGenerator.TreeGeneratorState emptyState()
- emptyState in interface StateStack<E>
pushNewDepthState
public void pushNewDepthState(int unaryCount,
int binaryCount)
Push a new state that upon execution will start working with new unary and binary count.
pushRecurseState
public void pushRecurseState(int depth,
int pos,
int endpos)
pushRemoveState
public final void pushRemoveState(int depth,
int leftrightpos,
int parent)
Push a new state that upon execution will remove the node with the given coordinates.
depth
- depth in the treeleftrightpos
- position relative to the parent
: 0
for left, 1
for rightparent
- parent of the node to be removed