Class NFA.Builder
java.lang.Object
it.tugamer89.autogex.core.AbstractAutomatonBuilder<NFA.Builder, NFA>
it.tugamer89.autogex.models.NFA.Builder
- Enclosing class:
NFA
Builder pattern to construct the NFA fluently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTransition(String fromName, char symbol, String toName) Adds a non-deterministic 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 NFA Builder.
-
-
Method Details
-
addTransition
Adds a non-deterministic 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<NFA.Builder, NFA>- Returns:
- The compiled automaton.
-