Interface State

All Known Implementing Classes:
AutomatonState, CountingState, DeterminizedState, NonDeterminizedState, SuffixState

public interface State
A State is a dynamic state of the finite state machine. It may either be a static (non-counting) AutomatonState, or a dynamically-created CountingState, which represents the combination of an AutomatonState and a counter value
  • Method Summary

    Modifier and Type
    Method
    Description
    Get an iterator over all the transitions (edges) allowed from this state
    getTransition(int token, UserComplexType type)
    Find the edge representing the transition from this state to another state, that is triggered by a given input token
    Get an array of the wildcard transitions (edges) allowed from this state.
    boolean
    Ask whether this state is a valid final state, that is, no further transitions are needed to complete a successful path through the finite state machine
    Construct a human-readable message explaining what elements are permitted as transitions from this state
  • Method Details

    • getTransition

      Edge getTransition(int token, UserComplexType type)
      Find the edge representing the transition from this state to another state, that is triggered by a given input token
      Parameters:
      token - the input token, specifically the fingerprint of an element name
      type - the complex type whose content model we are validating against
      Returns:
      the Edge representing the selected transition of the finite state machine, or null if this token is not accepted when in this State (which implies a validation error).
    • isFinalState

      boolean isFinalState()
      Ask whether this state is a valid final state, that is, no further transitions are needed to complete a successful path through the finite state machine
      Returns:
      true if this is a valid final state
    • listAllowedElements

      CharSequence listAllowedElements()
      Construct a human-readable message explaining what elements are permitted as transitions from this state
      Returns:
      A message indicating what elements may come next
    • getWildcardEdges

      Edge[] getWildcardEdges()
      Get an array of the wildcard transitions (edges) allowed from this state.
      Returns:
      an array containing all the edges that represent element wildcards.
    • getEdges

      Iterable<Edge> getEdges()
      Get an iterator over all the transitions (edges) allowed from this state
      Returns:
      an Iterator over all the edges from this state. The objects returned by this Iterator are Edge objects.