Linkable.Analysis
Class ContextSection
java.lang.Object
|
+--Linkable.Analysis.ContextSection
- public class ContextSection
- extends java.lang.Object
Method Summary |
private void |
abortSeqBuilding()
|
protected void |
checkForHeader(java.lang.String name,
org.xml.sax.AttributeList attrs)
determines whether this start tag is marking off a section header. |
protected void |
deleteSequelnce(java.util.Vector v)
Removes one sequence, if present, from the array of possible
sequences for starting a section header. |
private boolean |
f(java.util.Vector v,
java.lang.String name,
org.xml.sax.AttributeList attrs)
Determine whether this tag/attributes matches the appropriate
Vector in this possible sequence |
private java.util.Vector |
getVector(java.lang.String[] arg)
|
protected void |
handleEndTag(java.lang.String name)
determines whether this is the end of a section header. |
protected boolean |
handleStartTag(java.lang.String name,
org.xml.sax.AttributeList attrs)
determines whether this tag might end an author section and
start the context process. |
protected void |
handleText()
called while scanning authors whenever text is encountered. |
protected boolean |
isReference(java.lang.String text)
determines whether this is a reference section, meaning that
we transition from doing contexts to doing references |
private boolean |
matchesAtLeastOne(java.lang.String name,
org.xml.sax.AttributeList attrs)
Determine whether this is a possible section header sequence |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
ME
private static java.lang.String ME
DEBUG
private static boolean DEBUG
sectionName
private java.util.Vector sectionName
seqComplete
private boolean seqComplete
isSectionHeader
private boolean isSectionHeader
possibleSHSeqs
private java.util.Vector[] possibleSHSeqs
min_max
private int[] min_max
index
private int index
tagsMatched
private int tagsMatched
ContextSection
public ContextSection()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
handleStartTag
protected boolean handleStartTag(java.lang.String name,
org.xml.sax.AttributeList attrs)
- determines whether this tag might end an author section and
start the context process. Called only when "startAuthor" is true
and at least one author has been found already;
and we are not inside a table.
(TBD: and we have processed fewer than SOME-PARAMETER start tags)
Section Headers can be H3, H4, H5, strong, font size=+1, and
- Parameters:
name
- of start tagattributes
- of the start tag
handleEndTag
protected void handleEndTag(java.lang.String name)
- determines whether this is the end of a section header.
- Parameters:
name
- of the end tag
checkForHeader
protected void checkForHeader(java.lang.String name,
org.xml.sax.AttributeList attrs)
- determines whether this start tag is marking off a section header.
called only when "doContexts" is true. index is next position in
sectionName to be matched by this tag. This is sort of a handle
StartTag.
handleText
protected void handleText()
- called while scanning authors whenever text is encountered.
Any text aborts possible section header that was only partially
scanned.
isReference
protected boolean isReference(java.lang.String text)
- determines whether this is a reference section, meaning that
we transition from doing contexts to doing references
deleteSequelnce
protected void deleteSequelnce(java.util.Vector v)
- Removes one sequence, if present, from the array of possible
sequences for starting a section header. Called by AuthorSection
after the author start sequence has been ascertained, since it
should not be possible to have authors and section headers starting
with the same sequence.
getVector
private java.util.Vector getVector(java.lang.String[] arg)
abortSeqBuilding
private void abortSeqBuilding()
matchesAtLeastOne
private boolean matchesAtLeastOne(java.lang.String name,
org.xml.sax.AttributeList attrs)
- Determine whether this is a possible section header sequence
- Parameters:
Vector
- of strings that have been encountered so far
Global variable min_max is the lowest and highest indices
in possibleSHSeqs that we might be matched.
f
private boolean f(java.util.Vector v,
java.lang.String name,
org.xml.sax.AttributeList attrs)
- Determine whether this tag/attributes matches the appropriate
Vector in this possible sequence
- Returns:
- true if this tag fits with at least one sequence.