laser.regularlanguage.fsa.util
Class Inflater<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.fsa.util.Inflater<L>

public class Inflater<L extends LabelInterface>
extends java.lang.Object

The Inflater class inflates the given FSA with regards to the specified Alphabet. Formally:

Let old FSA F = (Q, Σ, q0, F, T, source, target, label)

Let the new alphabet be Σ'.

Let the new FSA F' = (Q, Σ', q0, F, T', source', target', label')

Author:
Heather M. Conboy (laser-software@cs.umass.edu)

Constructor Summary
Inflater()
          Creates a new Inflater.
 
Method Summary
protected  void checkPreconditions(FSAInterface<L> oldFSA, AlphabetInterface<L> newAlphabet)
          Checks the preconditions for the Inflater.
 MutableFSAInterface<L> inflateConstructive(FSAInterface<L> oldFSA, AlphabetInterface<L> newAlphabet, java.lang.Object... transitionArgs)
          Inflates the given FSA with regards to the specified Alphabet by creating a clone of the FSA, setting its alphabet to the specified Alphabet, and adding self-loop transitions (transitions for which source and target return the same state) on every state for each Label in the Alphabet of the new FSA that is not equal to a Label in the Alphabet of the original FSA.
 void inflateDestructive(MutableFSAInterface<L> fsa, AlphabetInterface<L> newAlphabet, java.lang.Object... transitionArgs)
          Inflates the given FSA with regards to the specified Alphabet by setting its alphabet to the specified Alphabet and adding self-loop transitions (transitions for which source and target return the same state) on every state for each Label in the Alphabet of the new FSA that is not equal to a Label in the Alphabet of the original FSA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inflater

public Inflater()
Creates a new Inflater.

Method Detail

checkPreconditions

protected void checkPreconditions(FSAInterface<L> oldFSA,
                                  AlphabetInterface<L> newAlphabet)
Checks the preconditions for the Inflater.

Parameters:
oldFSA - The old FSA being inflated
newAlphabet - The new alphabet to be used

inflateConstructive

public MutableFSAInterface<L> inflateConstructive(FSAInterface<L> oldFSA,
                                                  AlphabetInterface<L> newAlphabet,
                                                  java.lang.Object... transitionArgs)
Inflates the given FSA with regards to the specified Alphabet by creating a clone of the FSA, setting its alphabet to the specified Alphabet, and adding self-loop transitions (transitions for which source and target return the same state) on every state for each Label in the Alphabet of the new FSA that is not equal to a Label in the Alphabet of the original FSA.

PRECONDITIONS:

The old FSA must be non-null.

The new alphabet must be non-null.

The new alphabet must be a superset of the old FSA's alphabet.

The transitionArgs must be valid.

Parameters:
oldFSA - The specified FSA.
newAlphabet - The specified Alphabet.
transitionArgs - Any required arguments for the new transitions.
Returns:
The inflated FSA.

inflateDestructive

public void inflateDestructive(MutableFSAInterface<L> fsa,
                               AlphabetInterface<L> newAlphabet,
                               java.lang.Object... transitionArgs)
Inflates the given FSA with regards to the specified Alphabet by setting its alphabet to the specified Alphabet and adding self-loop transitions (transitions for which source and target return the same state) on every state for each Label in the Alphabet of the new FSA that is not equal to a Label in the Alphabet of the original FSA.

PRECONDITIONS:

The FSA must be non-null.

The new alphabet must be non-null.

The new alphabet must be a superset of the FSA's alphabet.

The transitionArgs must be valid.

Parameters:
fsa - The specified FSA.
newAlphabet - The specified Alphabet.
transitionArgs - Any required arguments for the new transitions.