gate.fsm
Class Transition

java.lang.Object
  extended by gate.fsm.Transition
All Implemented Interfaces:
Serializable, Comparable

public class Transition
extends Object
implements Serializable, Comparable

This class implements a Finite State Machine transition. A transition is owned by a gate.fsm.State object and contains set of restrictions and a reference to the next state that will be accessed after consuming a set of input symbols according to the restrictions. A transition can also hold information about the label that should be bound to the symbols (annotations) consumed during the state transition.

See Also:
Serialized Form

Constructor Summary
Transition()
          Default constructor.
Transition(BasicPatternElement constraints, State state)
          Creates a new transition using the given set of constraints and target state.
Transition(BasicPatternElement constraints, State state, LinkedList bindings)
          Creates a new transition from a set of constraints, a target state and a list of labels to be bound with the recognized input symbols (aka annotations).
 
Method Summary
 int compareTo(Object o)
           
 LinkedList getBindings()
          Returns the list of bindings associated to this transition
 BasicPatternElement getConstraints()
          Gets the constraints associated to this transition
 State getTarget()
          Gets the target state of this transition
 boolean hasConstraints()
          Returns a boolean value indicating whether this Transition has any constraints on it.
 boolean isMultiType()
          Returns a boolean value indicating whether this Transition deals with multiple types of annotations.
 boolean satisfiedBy(Annotation[] coIncidentAnnos)
          Returns true if all the constraints on this transition are satisfied by the given Annotations, false otherwise.
 String shortDesc()
          Returns a shorter description that toSting().
 Transition spawn(State s)
          Creates a new transition to the given State with the same bindings as this one.
 String toString()
          Returns a textual desciption of this transition.
 String toString(boolean includeTarget)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transition

public Transition()
Default constructor. Creates a new transition with a new unique index. This constructor should be called by all other constructors.


Transition

public Transition(BasicPatternElement constraints,
                  State state)
Creates a new transition using the given set of constraints and target state.

Parameters:
constraints - the set on constraints associated to this transition
state - the target state of this transition

Transition

public Transition(BasicPatternElement constraints,
                  State state,
                  LinkedList bindings)
Creates a new transition from a set of constraints, a target state and a list of labels to be bound with the recognized input symbols (aka annotations).

Method Detail

spawn

public Transition spawn(State s)
Creates a new transition to the given State with the same bindings as this one.


getTarget

public State getTarget()
Gets the target state of this transition

Returns:
an object of type gate.fsm.State

getConstraints

public BasicPatternElement getConstraints()
Gets the constraints associated to this transition


hasConstraints

public boolean hasConstraints()
Returns a boolean value indicating whether this Transition has any constraints on it.


satisfiedBy

public boolean satisfiedBy(Annotation[] coIncidentAnnos)
Returns true if all the constraints on this transition are satisfied by the given Annotations, false otherwise. The given Annotations should be the set of Annotations beginning at a single point in the document.


isMultiType

public boolean isMultiType()
Returns a boolean value indicating whether this Transition deals with multiple types of annotations.


toString

public String toString()
Returns a textual desciption of this transition.

Overrides:
toString in class Object
Returns:
a String

toString

public String toString(boolean includeTarget)

shortDesc

public String shortDesc()
Returns a shorter description that toSting(). Actually, it returns the unique index in String form.


getBindings

public LinkedList getBindings()
Returns the list of bindings associated to this transition


compareTo

public int compareTo(Object o)
              throws ClassCastException
Specified by:
compareTo in interface Comparable
Throws:
ClassCastException