Class ZAutomaton.Trace

java.lang.Object
eu.bandm.tools.lexic.ZAutomaton.Trace
All Implemented Interfaces:
Automaton.Trace<List<V>>
Enclosing class:
ZAutomaton<V>

public class ZAutomaton.Trace extends Object implements Automaton.Trace<List<V>>
Iterator-like mutable API for tracking the consumption of an input sequence of code points by an automaton.

This implementation is very efficient and suitable for performance-critical applications.

  • Constructor Details

    • Trace

      public Trace()
      Creates a new instance.
  • Method Details

    • restart

      public void restart()
      Description copied from interface: Automaton.Trace
      Jumps to the initial state(s).
      Specified by:
      restart in interface Automaton.Trace<List<V>>
    • step

      public boolean step(int c)
      Description copied from interface: Automaton.Trace
      Attempts a state transition by consuming one code point.
      Specified by:
      step in interface Automaton.Trace<List<V>>
      Parameters:
      c - the code point to consume
      Returns:
      true if the transition was successful; false otherwise
      See Also:
    • getLabel

      public List<V> getLabel()
      Description copied from interface: Automaton.Trace
      Returns the label associated with the current state(s).
      Specified by:
      getLabel in interface Automaton.Trace<List<V>>
      Returns:
      the label associated with the current state(s)