edu.buffalo.nsf.xmlcqa.data.dtd
Class Union

java.lang.Object
  extended byedu.buffalo.nsf.xmlcqa.data.dtd.NDFA
      extended byedu.buffalo.nsf.xmlcqa.data.dtd.RegExpr
          extended byedu.buffalo.nsf.xmlcqa.data.dtd.Union
All Implemented Interfaces:
Constants

public class Union
extends RegExpr

A class representing a union of two regular expressions. The first and second subexpressions are accesible by getExpr1() and getExpr2() respectively. A word belongs to a union of regular expressions if the word belongs to the first subexpresion, second subexpressions, or both of them.

Author:
Slawomir Staworko

Field Summary
protected  RegExpr expr1
           
protected  RegExpr expr2
           
 
Fields inherited from class edu.buffalo.nsf.xmlcqa.data.dtd.NDFA
EPSILON
 
Fields inherited from interface edu.buffalo.nsf.xmlcqa.Constants
INF
 
Constructor Summary
Union(RegExpr expr1, RegExpr expr2)
          Standard constructor.
 
Method Summary
protected  void _fillDelta(boolean[][][] delta, int offset)
          Used to fill tag driven part of the transition table of a regular expression whose position if relative to offset.
protected  void _fillEpsilonDelta(boolean[][] delta, int offset)
          Used to fill epsilon part of the transition talbe of a regular expressio whose possition is relative to offset.
protected  void _fillFinalStates(boolean[] f, int offset)
          Used to indicate final states of a regular expression whose position is relative to offset.
protected  int _getStateCount()
          Should return the number of states the implementation is using.
 NDFA getExpr1()
          Returns the first subexpression.
 NDFA getExpr2()
          Returns the second subexpression.
 java.lang.String toString()
          Returns string representation of the regular expression.
 
Methods inherited from class edu.buffalo.nsf.xmlcqa.data.dtd.RegExpr
getDelta, getEpsilonDelta, getFinalStates, getFstIndTrDelta, getFstTagTrDelta, getMinCostDelta, getStateCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

expr1

protected RegExpr expr1

expr2

protected RegExpr expr2
Constructor Detail

Union

public Union(RegExpr expr1,
             RegExpr expr2)
Standard constructor. Initializes the object.

Method Detail

_fillDelta

protected void _fillDelta(boolean[][][] delta,
                          int offset)
Description copied from class: RegExpr
Used to fill tag driven part of the transition table of a regular expression whose position if relative to offset. The implementing class doesn't have indicate transitions obtained in a consequence of clousure under epsilon transition. This clousure will be computed automatically by this class.

Specified by:
_fillDelta in class RegExpr

_fillEpsilonDelta

protected void _fillEpsilonDelta(boolean[][] delta,
                                 int offset)
Description copied from class: RegExpr
Used to fill epsilon part of the transition talbe of a regular expressio whose possition is relative to offset. The implementing class doesn't have indicate transitions obtained in the consequence of the clousure. This clousure will be computed by this class.

Specified by:
_fillEpsilonDelta in class RegExpr

_fillFinalStates

protected void _fillFinalStates(boolean[] f,
                                int offset)
Description copied from class: RegExpr
Used to indicate final states of a regular expression whose position is relative to offset.

Specified by:
_fillFinalStates in class RegExpr

_getStateCount

protected int _getStateCount()
Description copied from class: RegExpr
Should return the number of states the implementation is using. This method will be executed only once and its result stored and returned with each call of RegExpr.getStateCount() method (memoization).

Specified by:
_getStateCount in class RegExpr

getExpr1

public NDFA getExpr1()
Returns the first subexpression.


getExpr2

public NDFA getExpr2()
Returns the second subexpression.


toString

public java.lang.String toString()
Returns string representation of the regular expression.