laser.regularlanguage.fsa
Class FSALabelTransition<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.fsa.AbstractFSATransition<L>
      extended by laser.regularlanguage.fsa.FSALabelTransition<L>
Type Parameters:
L - The type of Label associated with the FSA that contains this transition.
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FSATransitionInterface<L>>, FSALabelTransitionInterface<L>, FSATransitionInterface<L>, Annotatable

public class FSALabelTransition<L extends LabelInterface>
extends AbstractFSATransition<L>
implements FSALabelTransitionInterface<L>

This class represents transitions on a Label in FSAs of type AbstractFSA.

Note that this class is not synchronized, and attempts to use it with non-sequential code may result in unexpected behavior.

Author:
Nathan Jokel (laser-software@cs.umass.edu)
See Also:
AbstractFSA, FSALabelTransitionInterface, LabelInterface, Serialized Form

Constructor Summary
protected FSALabelTransition(int id, FSAStateInterface<L> source, L label, FSAStateInterface<L> target)
          Creates a new FSALabelTransition from the specified source state to the specified target state on the specified Label with the specified ID.
 
Method Summary
 L getLabel()
          Returns a copy of the Label of this transition (the result of evaluting the label function of the FSA that contains this transition with this transition as input).
protected  java.lang.String toStringLabel()
          Returns a String representation of the label function of this AbstractFSATransition.
 
Methods inherited from class laser.regularlanguage.fsa.AbstractFSATransition
addAnnotation, addAnnotations, compareTo, copyAnnotations, getAnnotationClasses, getAnnotationClasses, getAnnotationFilters, getAnnotations, getAnnotations, getFSA, getID, getSource, getTarget, isSelfLoop, removeAnnotation, removeAnnotations, removeAnnotations, removeAnnotations, setAnnotationFilters, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface laser.regularlanguage.fsa.FSATransitionInterface
getFSA, getID, getSource, getTarget
 
Methods inherited from interface laser.util.Annotatable
addAnnotation, addAnnotations, copyAnnotations, getAnnotationClasses, getAnnotationClasses, getAnnotationFilters, getAnnotations, getAnnotations, removeAnnotation, removeAnnotations, removeAnnotations, removeAnnotations, setAnnotationFilters
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

FSALabelTransition

protected FSALabelTransition(int id,
                             FSAStateInterface<L> source,
                             L label,
                             FSAStateInterface<L> target)
Creates a new FSALabelTransition from the specified source state to the specified target state on the specified Label with the specified ID.

This constructor should only be called by the AbstractFSAFactory._createFSALabelTransitionInterface(int, laser.regularlanguage.fsa.FSAStateInterface, L, laser.regularlanguage.fsa.FSAStateInterface, java.lang.Object...) method.

Precondition: source, target, and label are not null, source and target are a part of the same FSA and label is equal to a Label in the Alphabet of that FSA..

Parameters:
id - The ID.
source - The state that is the source of this transition.
label - The Label of this transition.
target - The state that is the target of this transition.
See Also:
AbstractFSAFactory._createFSALabelTransitionInterface(int, laser.regularlanguage.fsa.FSAStateInterface, L, laser.regularlanguage.fsa.FSAStateInterface, java.lang.Object...)
Method Detail

getLabel

public L getLabel()
Returns a copy of the Label of this transition (the result of evaluting the label function of the FSA that contains this transition with this transition as input). No references are maintained between the returned Label and the Label on the transition, thus modifying the returned Label has no effect on the Label of the transition and vice versa.

Specified by:
getLabel in interface FSALabelTransitionInterface<L extends LabelInterface>
Returns:
A copy of the Label of this transition.

toStringLabel

protected java.lang.String toStringLabel()
Returns a String representation of the label function of this AbstractFSATransition.

Specified by:
toStringLabel in class AbstractFSATransition<L extends LabelInterface>
Returns:
A String representation of the label function