Class GraphWalkerStackFrame<V>
java.lang.Object
de.serra.graph_walker.GraphWalkerStackFrame<V>
- Type Parameters:
V- The type of the "main" value associated with this stack frame.
Represents the method specific state at this point in the call stack.
Supports Tail-Recursion by just modifying the current stack frame.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe types of methods available for dispatching. -
Constructor Summary
ConstructorsConstructorDescriptionGraphWalkerStackFrame(GraphWalkerStackFrame.State state, V value) Constructs. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIs this stack frame is being returned to.voidleave()Marks the stackframe as being returned to.protected voidSets the direction to entering again.state()The state decides which method to use for dispatching to the correct method.value()The "main" value associated with this stack frame.
-
Constructor Details
-
GraphWalkerStackFrame
Constructs.- Parameters:
state- The State to use for dispatching to the correct method.value- The "main" value associated with this stack frame.
-
-
Method Details
-
state
The state decides which method to use for dispatching to the correct method.- Returns:
- The state.
-
value
The "main" value associated with this stack frame.- Returns:
- The "main" value.
-
leave
public void leave()Marks the stackframe as being returned to.- See Also:
-
isLeaving
@Pure public boolean isLeaving()Is this stack frame is being returned to.- Returns:
truewhen this stack frame is being returned to.falseotherwise.
-
resetDirection
protected void resetDirection()Sets the direction to entering again.
-