Class DFA.Builder
- Enclosing class:
DFA
Builder pattern to construct the DFA fluently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTransition(String fromName, char symbol, String toName) Adds a transition between two states.build()Builds and returns the final automaton instance.Methods inherited from class AbstractAutomatonBuilder
addState, getFinalStates, getInitialState, getStatesMap, setInitialState
-
Constructor Details
-
Builder
public Builder()Default constructor for DFA Builder.
-
-
Method Details
-
addTransition
Adds a transition between two states.- Parameters:
fromName- The name of the source state.symbol- The character required to trigger the transition.toName- The name of the destination state.- Returns:
- The current builder instance.
-
build
Description copied from class:AbstractAutomatonBuilderBuilds and returns the final automaton instance.- Specified by:
buildin classAbstractAutomatonBuilder<DFA.Builder, DFA>- Returns:
- The compiled automaton.
-