Class StateMachine

java.lang.Object
org.biojava.bio.program.tagvalue.StateMachine
All Implemented Interfaces:
TagValueListener, TagValueWrapper

public class StateMachine extends Object implements TagValueWrapper
This class implements a state machine for parsing events from the Parser class.

Each State can be specified to deliver events to a particular TagValueListener.

Transitions can be specified to occur between States when specific events are encountered. These events can be Tags delivered by startTag as well as the endTag/endRecord events. Events that result in exit from the current State can be specified to be notifiable to the State listener.

In addition, tables of transitions can be defined and specified as the fallback when the a corresponding Transition cannot be found for the tag. This is useful for specifying the destination States that are globally applicable for particular tags. As the fallbacks can be chained, you can end up with a hierarchy of Transition Tables, some being State-specific, others applicable to groups of States and finally one being global.

Author:
David Huen