Package org.biojava.utils.automata
Class Nfa
- java.lang.Object
-
- org.biojava.utils.automata.FiniteAutomaton
-
- org.biojava.utils.automata.Nfa
-
- All Implemented Interfaces:
NfaBuilder
public class Nfa extends FiniteAutomaton implements NfaBuilder
Class for modelling non-deterministic finite automata.This implementation has epsilon and lambda transitions. Both transitions are silent but the former is intended to be optimised away while the latter must be retained during optimisation. This is necessary to implement limited closure for the REs that one may want to build with this NFA.
- Since:
- 1.4
- Author:
- David Huen
-
-
Field Summary
-
Fields inherited from class org.biojava.utils.automata.FiniteAutomaton
end, nodes, start, transitions
-
-
Constructor Summary
Constructors Constructor Description Nfa(String name, FiniteAlphabet alfa)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.biojava.utils.automata.FiniteAutomaton.Transition
addEpsilonTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end)
Add a silent optimisable transition to instance.org.biojava.utils.automata.FiniteAutomaton.Transition
addLambdaTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end)
Add a silent persistent transition to instance.protected int
alphaIndex(Symbol sym)
boolean
containsNode(org.biojava.utils.automata.FiniteAutomaton.Node node)
-
Methods inherited from class org.biojava.utils.automata.FiniteAutomaton
addNode, addTransition, createNodeSet, getAutomaton, getEnd, getNodes, getStart, getTransitions, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.automata.NfaBuilder
addNode, addTransition, createNodeSet, getAutomaton, getEnd, getNodes, getStart, getTransitions, toString
-
-
-
-
Constructor Detail
-
Nfa
public Nfa(String name, FiniteAlphabet alfa)
-
-
Method Detail
-
alphaIndex
protected int alphaIndex(Symbol sym) throws IllegalSymbolException
- Overrides:
alphaIndex
in classFiniteAutomaton
- Throws:
IllegalSymbolException
-
containsNode
public boolean containsNode(org.biojava.utils.automata.FiniteAutomaton.Node node)
-
addEpsilonTransition
public org.biojava.utils.automata.FiniteAutomaton.Transition addEpsilonTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end)
Add a silent optimisable transition to instance.- Specified by:
addEpsilonTransition
in interfaceNfaBuilder
-
addLambdaTransition
public org.biojava.utils.automata.FiniteAutomaton.Transition addLambdaTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end)
Add a silent persistent transition to instance.- Specified by:
addLambdaTransition
in interfaceNfaBuilder
-
-