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.

public class GraphWalkerStackFrame<V> extends Object
Represents the method specific state at this point in the call stack. Supports Tail-Recursion by just modifying the current stack frame.
  • Constructor Details

    • GraphWalkerStackFrame

      public GraphWalkerStackFrame(GraphWalkerStackFrame.State state, V value)
      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

      @Pure public GraphWalkerStackFrame.State state()
      The state decides which method to use for dispatching to the correct method.
      Returns:
      The state.
    • value

      @Pure public V 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:
      true when this stack frame is being returned to. false otherwise.
    • resetDirection

      protected void resetDirection()
      Sets the direction to entering again.