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

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.Clousure
All Implemented Interfaces:
Constants

public class Clousure
extends RegExpr

A class representing Kleene's clousure. The expression of which the colsure is being defined can be accessed with getExpr() method. The set of words defined by this regular expression is defined to beexactly those who are concatenation of any (incuding zero) number of words satisfying the subexpression.

Author:
staworko

Field Summary
protected  RegExpr expr
           
 
Fields inherited from class edu.buffalo.nsf.xmlcqa.data.dtd.NDFA
EPSILON
 
Fields inherited from interface edu.buffalo.nsf.xmlcqa.Constants
INF
 
Constructor Summary
Clousure(RegExpr expr)
          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 getExpr()
          Access the expression of which the closure is defined.
 java.lang.String toString()
          Returns a string representation of this 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

expr

protected RegExpr expr
Constructor Detail

Clousure

public Clousure(RegExpr expr)
Standard constructor.

Parameters:
expr - the regular expression of which the closure is being created
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

getExpr

public NDFA getExpr()
Access the expression of which the closure is defined.

Returns:
the regular expression of which the closure is defined by the given instance

toString

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