|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTreeAnnotater
public class TreeAnnotater
Performs brute-force (that is, stupid but reliable) single-term searching and hit marking on a DOM tree.
Field Summary | |
---|---|
private StandardAnalyzer |
analyzer
|
private Document |
doc
|
private String |
searchTerm
|
private int |
totalHitCount
|
private static String |
xtfUri
|
Constructor Summary | |
---|---|
TreeAnnotater()
|
Method Summary | |
---|---|
private boolean |
isAllWhitespace(String s)
Determine whether a string contains only whitespace characters. |
void |
processDocument(Document doc,
String term)
Process an entire document, marking hits and hit counts as we go. |
int |
processElement(Element parent,
int level)
Traverse an element of the tree. |
private int |
processText(Text node)
Recursively scans a text node for hits. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private StandardAnalyzer analyzer
private String searchTerm
private Document doc
private static final String xtfUri
private int totalHitCount
Constructor Detail |
---|
public TreeAnnotater()
Method Detail |
---|
public void processDocument(Document doc, String term)
private boolean isAllWhitespace(String s)
public int processElement(Element parent, int level)
parent
- The element to traverse
private int processText(Text node)
node
- Node to scan
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |