laser.regularlanguage.regularexpression.util
Class RegularExpressions<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.regularexpression.util.AbstractRegularExpressions<L>
      extended by laser.regularlanguage.regularexpression.util.RegularExpressions<L>
Type Parameters:
L - The type of Label associated with the REs.

public class RegularExpressions<L extends LabelInterface>
extends AbstractRegularExpressions<L>

The RegularExpressions class contains various methods for manipulating regular expressions (REs).

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

Field Summary
 
Fields inherited from class laser.regularlanguage.regularexpression.util.AbstractRegularExpressions
alphabetFactory_, DESCRIPTION_PREFIX, DESCRIPTION_SEPARATOR, DESCRIPTION_SUFFIX, NAME_SEPARATOR, reFactory_
 
Constructor Summary
RegularExpressions(REFactory<L> reFactory)
          Creates a new RegularExpressions class.
 
Method Summary
protected  void checkClass(RE<L> theRE)
          Checks that the RE's class is supported.
protected  REReader<L> createREReader()
          Creates a new REReader to read in REs.
protected  REWriter<L> createREWriter()
          Creates a new REWriter to write out REs.
 RE<L> read(java.io.Reader in)
          Reads in the RE from the given input Reader.
 void write(RE<L> theRE, java.io.Writer out)
          Writes out the given RE to the specified output Writer.
 
Methods inherited from class laser.regularlanguage.regularexpression.util.AbstractRegularExpressions
checkPreconditions, concatenation, convertExtendedREtoRE, empty, epsilon, getREFactory, label, normalize, read, setREAttributes, setREAttributes, simplify, star, union, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularExpressions

public RegularExpressions(REFactory<L> reFactory)
Creates a new RegularExpressions class.

Parameters:
reFactory - The REFactory to be used to create new REs (non-null)
Method Detail

createREReader

protected REReader<L> createREReader()
Creates a new REReader to read in REs.

Returns:
The appropriate REReader

createREWriter

protected REWriter<L> createREWriter()
Creates a new REWriter to write out REs.

Returns:
The appropriate REWriter

checkClass

protected void checkClass(RE<L> theRE)
Checks that the RE's class is supported.

Specified by:
checkClass in class AbstractRegularExpressions<L extends LabelInterface>
Parameters:
theRE - The RE to be checked

read

public RE<L> read(java.io.Reader in)
                                  throws java.io.IOException,
                                         REException
Reads in the RE from the given input Reader.

Specified by:
read in class AbstractRegularExpressions<L extends LabelInterface>
Parameters:
in - The Reader to be used as input (non-null)
Returns:
The corresponding RE
Throws:
java.io.IOException - if an I/O related error occurs
REException - if an RE related error occurs

write

public void write(RE<L> theRE,
                  java.io.Writer out)
           throws java.io.IOException,
                  REException
Writes out the given RE to the specified output Writer.

PRECONDITIONS:

Specified by:
write in class AbstractRegularExpressions<L extends LabelInterface>
Parameters:
theRE - The RE to be written out
out - The Writer to be used as output (non-null)
Throws:
java.io.IOException - if an I/O related error occurs
REException - if an RE related error occurs