|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.buffalo.nsf.xmlcqa.data.dtd.NDFA
edu.buffalo.nsf.xmlcqa.data.dtd.RegExpr
edu.buffalo.nsf.xmlcqa.data.dtd.Tag
Class representing tag label of a document. It's assumed that the number of
all tags processed by the system is small enought to be stored in memeory
at any time. Therefore we use exactly one object to represent the same
labels and comparison of two objects of this class can be done by simple
pointer comparison. Also, we identify this object with an integer
idetifier
. Tags can be accessed using two methods:
get(String tagName)
and getTag(int tagID)
. The number of
currenty known tags can be obtained with getCount()
method.
Tags are number with consequitive integers starting with 0
. It is
important to realize that if new, previously unknown tags are being created
between two calls to the method getCount()
, then the returned values
will be different. Therefore it is advised to create in advance all tags that
are expected to be used, so that after this process the method
getCount()
resturns a constant value.
A tag is also a regular expression specifying only one word: the word
consisting of only the tag's name (accssesible with getName()
).
Field Summary | |
---|---|
protected int |
hash
|
int |
ID
A field storing identifier of the tag. |
protected java.lang.String |
name
|
static Tag |
PCDATA_TAG
A constant tag used to label text nodes in the input document. |
protected static java.util.List |
tagList
A list of currently known tags. |
protected static java.util.Map |
tags
A map between names of already created tags and thier instantions. |
Fields inherited from class edu.buffalo.nsf.xmlcqa.data.dtd.NDFA |
---|
EPSILON |
Fields inherited from interface edu.buffalo.nsf.xmlcqa.Constants |
---|
INF |
Constructor Summary | |
---|---|
protected |
Tag(java.lang.String name,
int ID)
|
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. |
int |
_hashCode()
|
static Tag |
get(java.lang.String tagName)
A method used to obtain a Tag instance with a given name. |
static int |
getCount()
|
java.lang.String |
getName()
Returns the name of the tag. |
static Tag |
getTag(int tagID)
A method used to obtain a Tag of a given identifier. |
int |
hashCode()
Returns the hash code value for this tag. |
java.lang.String |
toString()
Returns the string representation of this resulr 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, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int hash
public final int ID
protected java.lang.String name
public static Tag PCDATA_TAG
protected static java.util.List tagList
protected static java.util.Map tags
Constructor Detail |
protected Tag(java.lang.String name, int ID)
Method Detail |
protected void _fillDelta(boolean[][][] delta, int offset)
RegExpr
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.
_fillDelta
in class RegExpr
protected void _fillEpsilonDelta(boolean[][] delta, int offset)
RegExpr
offset
. The implementing class doesn't
have indicate transitions obtained in the consequence of the clousure. This clousure
will be computed by this class.
_fillEpsilonDelta
in class RegExpr
protected void _fillFinalStates(boolean[] f, int offset)
RegExpr
offset
.
_fillFinalStates
in class RegExpr
protected int _getStateCount()
RegExpr
RegExpr.getStateCount()
method (memoization).
_getStateCount
in class RegExpr
public int _hashCode()
public static Tag get(java.lang.String tagName)
public static int getCount()
public java.lang.String getName()
public static Tag getTag(int tagID)
tagID
is
greater than the number of currently known tags a ArrayIndexOutOfBoundsException
will be thrown.
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |