Class FSABuilder<S,​I,​A extends MutableFSA<S,​? super I>>

  • Type Parameters:
    S - state type
    I - input symbol type
    A - concrete automaton type

    public class FSABuilder<S,​I,​A extends MutableFSA<S,​? super I>>
    extends Object
    A fluent builder for FiniteStateAcceptors.
    • Method Detail

      • withAccepting

        public FSABuilder<S,​I,​A> withAccepting​(Object stateId)
        Marks the given state as accepting.
        Parameters:
        stateId - the object to identify the state
        Returns:
        the next fluent state
      • withAccepting

        public FSABuilder<S,​I,​A> withAccepting​(Object stateId,
                                                           Object... stateIds)
        Marks the given states as accepting.
        Parameters:
        stateId - the object to identify the mandatory state
        stateIds - the objects to identify the additional states
        Returns:
        the next fluent state
      • create

        public A create()
        Returns the constructed automaton.
        Returns:
        the automaton
      • withInitial

        public FSABuilder<S,​I,​A> withInitial​(Object stateId)
        Marks the given state as initial.
        Parameters:
        stateId - the object to identify the state
        Returns:
        the next fluent state
      • withInitial

        public FSABuilder<S,​I,​A> withInitial​(Object stateId,
                                                         Object... stateIds)
        Marks the given states as initial.
        Parameters:
        stateId - the object to identify the mandatory state
        stateIds - the objects to identify the additional states
        Returns:
        the next fluent state
      • from

        public FSABuilder.FSABuilder0 from​(Object stateId)
        Starts a definition of transition(s) from a given source state.
        Parameters:
        stateId - the object to identify the state
        Returns:
        the next fluent state
      • from

        public FSABuilder.FSABuilder0 from​(Object firstStateId,
                                           Object... otherStateIds)
        Starts a definition of transition(s) from multiple given source states.
        Parameters:
        firstStateId - the mandatory object to identify the first state
        otherStateIds - the optional objects to identify additional states
        Returns:
        the next fluent state