public class TextNode extends TreeNode
| Constructor | Description |
|---|---|
TextNode(TextNode toCopy,
DocumentNode parent,
int numChild) |
Copies a text node.
|
TextNode(String text,
DocumentNode parent,
TreeDocument doc,
int numChild,
Weighter w,
int level) |
Instantiates a new text node.
|
| Modifier and Type | Method | Description |
|---|---|---|
String |
dump(String prefix) |
Dump this node.
|
boolean |
evaluate(ConnectionManager conMgmr) |
Evaluate the modifications of this node.
|
void |
getNodeStats(HashMap<String,Integer> map) |
Gets the node statistics of the subtree rooted in this node: tagname =>
number nodes having this tag name.
|
String |
getOwnHash() |
Gets the hash of this single node (w/o its subtree).
|
org.jdom2.Element |
getSubDoc(org.jdom2.Element parent) |
Attaches the subtree rooted in this node to the node parent.
|
String |
getSubTreeHash() |
Gets the calculated hash of the subtree rooted in this node, in TextNodes
it equals the own hash.
|
String |
getTagName() |
Gets the tag name.
|
String |
getText() |
Gets the text content of this node.
|
double |
getTextDistance(TextNode cmp) |
Gets the distance between the texts of two nodes.
|
double |
getWeight() |
Gets the weight of this node.
|
protected void |
reSetupStructureDown(TreeDocument doc,
int numChild) |
Re-setup the document structure downwards.
|
protected void |
reSetupStructureUp() |
Re-setup the document structure upwards.
|
void |
setText(String newText) |
Sets the text content of this node.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddModification, contentDiffers, getDocument, getLevel, getModification, getParent, getType, getXPath, hasModification, isRoot, networkDiffers, resetModifications, rmModification, setModificationpublic TextNode(TextNode toCopy, DocumentNode parent, int numChild)
toCopy - the node to copyparent - the new parent or null if this is going to be rootnumChild - the number of that child among its siblingspublic TextNode(String text, DocumentNode parent, TreeDocument doc, int numChild, Weighter w, int level)
text - the text stored in this nodeparent - the parent node in the treedoc - the documentnumChild - the number of that child among its siblingsw - the weighterlevel - the level in the treepublic String getText()
public void setText(String newText)
newText - the text to be stored in this nodepublic boolean evaluate(ConnectionManager conMgmr)
TreeNodepublic String dump(String prefix)
TreeNodepublic org.jdom2.Element getSubDoc(org.jdom2.Element parent)
TreeNode
parent == null && this.getType () == TreeNode.TEXT_NODE
That means a text node cannot become root.protected void reSetupStructureDown(TreeDocument doc, int numChild)
TreeNodereSetupStructureDown in class TreeNodedoc - the document this node corresponds tonumChild - the child number of this nodeprotected void reSetupStructureUp()
TreeNodereSetupStructureUp in class TreeNodepublic void getNodeStats(HashMap<String,Integer> map)
TreeNodegetNodeStats in class TreeNodemap - the map to write our statistics topublic double getWeight()
TreeNodepublic String getOwnHash()
TreeNodegetOwnHash in class TreeNodepublic String getSubTreeHash()
TreeNodegetSubTreeHash in class TreeNodepublic String getTagName()
TreeNodeTreeNode.TEXT_TAG.getTagName in class TreeNodepublic double getTextDistance(TextNode cmp)
cmp - the node to compareCopyright © 2018 SEMS project @ University of Rostock. All rights reserved.