laser.regularlanguage.fsa
Interface FSAFactoryInterface<L extends LabelInterface>

Type Parameters:
L - The type of Label associated with the FSAs that this factory creates.
All Known Implementing Classes:
AbstractFSAFactory, IndexedDFAFactory, IndexedFSAFactory, StringDFAFactory, StringFSAFactory

public interface FSAFactoryInterface<L extends LabelInterface>

This interface is implemented by all factories that create finite state automata (FSAs) of type FSAInterface. Factories of this type create FSAs associated with one particular type of Label.

Author:
Nathan Jokel (laser-software@cs.umass.edu)
See Also:
FSAInterface, LabelInterface

Method Summary
 MutableFSAInterface<L> createMutableFSAInterface(AlphabetInterface<L> alphabet, java.lang.Object... args)
          Creates a mutable FSA from the specified arguments.
 AlphabetFactoryInterface<L> getAlphabetFactory()
          Gets the alphabet factory to be used to create new alphabets.
 java.lang.Object[] getCreateArgs(FSAInterface<L> oldFSA)
          Gets any required arguments for the FSA factory method from the given FSA.
 java.lang.Object[] getCreateArgs(FSAInterface<L> newFSA, FSAStateInterface<L> oldState)
          Gets any required arguments for the state factory method from the given state.
 java.lang.Object[] getCreateArgs(FSAInterface<L> newFSA, FSATransitionInterface<L> oldTransition)
          Gets any required arguments for the transition factory method from the given transition.
 

Method Detail

createMutableFSAInterface

MutableFSAInterface<L> createMutableFSAInterface(AlphabetInterface<L> alphabet,
                                                 java.lang.Object... args)
Creates a mutable FSA from the specified arguments.

PRECONDITIONS:

Parameters:
alphabet - The alphabet for the new FSA.
args - The arguments.
Returns:
The mutable FSA.
Throws:
java.lang.IllegalArgumentException - A mutable FSA can not be created from the specified arguments.

getAlphabetFactory

AlphabetFactoryInterface<L> getAlphabetFactory()
Gets the alphabet factory to be used to create new alphabets.

Returns:
The AlphabetFactoryInterface to be used to create new alphabets

getCreateArgs

java.lang.Object[] getCreateArgs(FSAInterface<L> oldFSA)
Gets any required arguments for the FSA factory method from the given FSA.

PRECONDITION: The oldFSA must be non-null.

Parameters:
oldFSA - The FSA to use as a prototype
Returns:
Any required arguments for the FSA factory method
See Also:
createMutableFSAInterface(AlphabetInterface, Object[])

getCreateArgs

java.lang.Object[] getCreateArgs(FSAInterface<L> newFSA,
                                 FSAStateInterface<L> oldState)
Gets any required arguments for the state factory method from the given state.

PRECONDITION:

Parameters:
newFSA - The FSA that will contain the new state
oldState - The FSA state to use as a prototype
Returns:
Any required arguments for the state factory method
See Also:
MutableFSAInterface.addState(Object[])

getCreateArgs

java.lang.Object[] getCreateArgs(FSAInterface<L> newFSA,
                                 FSATransitionInterface<L> oldTransition)
Gets any required arguments for the transition factory method from the given transition.

PRECONDITION:

Parameters:
newFSA - The FSA that will contain the new transition
oldTransition - The FSA transition to use as a prototype
Returns:
Any required arguments for the transition factory method
See Also:
MutableFSAInterface.addEpsilonTransition(FSAStateInterface, FSAStateInterface, Object[]), MutableFSAInterface.addTransition(FSAStateInterface, LabelInterface, FSAStateInterface, Object[]), MutableFSAInterface.addTransition(FSAStateInterface, LabelPatternInterface, FSAStateInterface, Object[])