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

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

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

The REReader class reads in the RE from the specified input.

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

Field Summary
protected  REFactory<L> reFactory_
          The REFactory to be used to create new REs
 
Constructor Summary
REReader(REFactory<L> reFactory)
          Creates a new REReader.
 
Method Summary
 RE<L> read(java.io.File inFile)
          Reads in the RE from the specified input File.
 RE<L> read(java.io.Reader in)
          Reads in the RE from the specified input Reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reFactory_

protected REFactory<L extends LabelInterface> reFactory_
The REFactory to be used to create new REs

Constructor Detail

REReader

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

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

read

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

Parameters:
inFile - The File to use as input (non-null)
Returns:
The RE that was read
Throws:
java.io.IOException - if an I/O related error occurs
REException - if an RE related error occurs

read

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

Parameters:
in - The Reader to use as input (non-null)
Returns:
The RE that was read
Throws:
java.io.IOException - if an I/O related error occurs
REException - if an RE related error occurs