Package org.biojava.utils.automata
Class FiniteAutomaton
- java.lang.Object
-
- org.biojava.utils.automata.FiniteAutomaton
-
- Direct Known Subclasses:
Nfa
public class FiniteAutomaton extends Object
Class for modelling finite automata.This class models basic FA behaviour. More specialised behaviour is implemented by subclassing this.
- Since:
- 1.4
- Author:
- David Huen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.biojava.utils.automata.FiniteAutomaton.Node
addNode(boolean terminal)
Add a node to the FA.org.biojava.utils.automata.FiniteAutomaton.Transition
addTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end, Symbol sym)
protected int
alphaIndex(Symbol sym)
org.biojava.utils.automata.FiniteAutomaton.NodeSet
createNodeSet()
FiniteAutomaton
getAutomaton()
org.biojava.utils.automata.FiniteAutomaton.Node
getEnd()
org.biojava.utils.automata.FiniteAutomaton.NodeSet
getNodes()
get all Nodes within this instance.org.biojava.utils.automata.FiniteAutomaton.Node
getStart()
Set
getTransitions()
retrieve Set of all transitions in instance.String
toString()
dumps internal data of Nodes and Transitions that describe this FiniteAutomaton.
-
-
-
Method Detail
-
getStart
public org.biojava.utils.automata.FiniteAutomaton.Node getStart()
-
getEnd
public org.biojava.utils.automata.FiniteAutomaton.Node getEnd()
-
getAutomaton
public FiniteAutomaton getAutomaton()
-
addTransition
public org.biojava.utils.automata.FiniteAutomaton.Transition addTransition(org.biojava.utils.automata.FiniteAutomaton.Node start, org.biojava.utils.automata.FiniteAutomaton.Node end, Symbol sym)
-
addNode
public org.biojava.utils.automata.FiniteAutomaton.Node addNode(boolean terminal)
Add a node to the FA.- Parameters:
terminal
- Is the Node terminal?
-
getNodes
public org.biojava.utils.automata.FiniteAutomaton.NodeSet getNodes()
get all Nodes within this instance.
-
getTransitions
public Set getTransitions()
retrieve Set of all transitions in instance.
-
createNodeSet
public org.biojava.utils.automata.FiniteAutomaton.NodeSet createNodeSet()
-
toString
public String toString()
dumps internal data of Nodes and Transitions that describe this FiniteAutomaton. It is not possible to dump it as a regex as there are FA that cannot be expressed as a regex.
-
alphaIndex
protected int alphaIndex(Symbol sym) throws IllegalSymbolException
- Throws:
IllegalSymbolException
-
-