Package org.biojava.bio.program.tagvalue
Class StateMachine.BasicState
java.lang.Object
org.biojava.bio.program.tagvalue.StateMachine.BasicState
- All Implemented Interfaces:
StateMachine.State
- Enclosing class:
- StateMachine
Implementation of a State in a state machine
-
Constructor Summary
ConstructorsConstructorDescriptionBasicState(String label) This is the default constructorBasicState(String label, TagValueListener listener) when this constructor is used, a fixed listener is used with this state. -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()return the label of this class.return the TagValueListener assigned to this State.retrieve the TransitionTable for this State.voidsetDefaultTransitions(StateMachine.TransitionTable defaultTransitions) specify fallback TransitionTable for this StatevoidsetListener(TagValueListener listener) set a TagValueListener for this State.voidsetTransition(Object tag, StateMachine.State destination) set a Transition for this State setting notifyOnExit to false.voidsetTransition(Object tag, StateMachine.State destination, boolean notifyOnExit) set a Transition for this StatevoidFind the destination State when the specified tag is encountered.
-
Constructor Details
-
BasicState
This is the default constructor -
BasicState
when this constructor is used, a fixed listener is used with this state. When setListener is called on this class, it is the listener of this fixed listener that is changed.
-
-
Method Details
-
getLabel
return the label of this class.- Specified by:
getLabelin interfaceStateMachine.State
-
getListener
return the TagValueListener assigned to this State.- Specified by:
getListenerin interfaceStateMachine.State
-
setListener
set a TagValueListener for this State. -
setTransition
public void setTransition(Object tag, StateMachine.State destination, boolean notifyOnExit) throws ParserException set a Transition for this State- Throws:
ParserException
-
setTransition
set a Transition for this State setting notifyOnExit to false.- Throws:
ParserException
-
getTransitionTable
retrieve the TransitionTable for this State. -
setDefaultTransitions
specify fallback TransitionTable for this State -
transit
Find the destination State when the specified tag is encountered. If the destination is successfully obtained, the listener is also notified of exit if required.- Specified by:
transitin interfaceStateMachine.State- Throws:
ParserException
-