laser.regularlanguage.regularexpression
Interface REFactory<L extends LabelInterface>

Type Parameters:
L - The type of Label associated with the REs.
All Known Implementing Classes:
DefaultREFactory, StringREFactory

public interface REFactory<L extends LabelInterface>

The REFactory interface allows the user to create new REs.

NOTE: This is a factory as in the design pattern, (Design Patterns, Gamma, Helm, Johnson,and Vlissides, pp 87, 107, 1995).

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

Method Summary
 RE<L> createRE(AlphabetInterface<L> alphabet, TreeNode<L> rootNode, java.lang.Object... args)
          Creates a new RE with the given alphabet and regular expression.
 AlphabetFactoryInterface<L> getAlphabetFactory()
          Gets the alphabet factory to be used to create new alphabets.
 java.lang.Object[] getCreateREArgs(RE<L> oldRE)
          Gets the appropriate arguments for the createRE method from the given RE.
 

Method Detail

createRE

RE<L> createRE(AlphabetInterface<L> alphabet,
               TreeNode<L> rootNode,
               java.lang.Object... args)
Creates a new RE with the given alphabet and regular expression.

PRECONDITIONS:

Parameters:
alphabet - The alphabet for the new RE
rootNode - The regular expression for the new RE
args - Any additional arguments (optional)
Returns:
The new RE
Throws:
java.lang.IllegalArgumentException - if any precondition is not met

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

getCreateREArgs

java.lang.Object[] getCreateREArgs(RE<L> oldRE)
Gets the appropriate arguments for the createRE method from the given RE.

PRECONDITIONS:

Parameters:
oldRE - The old RE
Returns:
The appropriate arguments for the createRE method