public class DefaultNode extends java.lang.Object implements Node
Node.ChildrenArg, Node.DescendantsArg, Node.RemoveArg, Node.ShiftArg
Constructor and Description |
---|
DefaultNode(Root tree) |
DefaultNode(Root tree,
Node parent) |
Modifier and Type | Method and Description |
---|---|
Node |
createChild()
Creates new child of the given node and returns it.
|
protected Node |
createNode() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getAddress() |
Bundle |
getBundle() |
java.util.List<Node> |
getChildren()
Returns children of the node in word order.
|
java.util.List<Node> |
getChildren(java.util.EnumSet<Node.ChildrenArg> args)
Returns children of the node in word order.
|
java.lang.String |
getDeprel() |
java.lang.String |
getDeps() |
java.util.List<Node> |
getDescendants() |
java.util.List<Node> |
getDescendants(java.util.EnumSet<Node.DescendantsArg> args) |
java.util.List<Node> |
getDescendants(java.util.EnumSet<Node.DescendantsArg> args,
Node except) |
java.util.List<Node> |
getDescendantsF() |
protected java.util.List<Node> |
getDescendantsInner(java.util.EnumSet<Node.DescendantsArg> args,
java.util.Optional<Node> except) |
Document |
getDocument() |
java.lang.String |
getFeats() |
java.lang.String |
getForm() |
java.lang.String |
getHead() |
int |
getId() |
java.lang.String |
getLemma() |
java.lang.String |
getMisc() |
java.util.Optional<Node> |
getNextNode() |
java.util.Optional<Node> |
getNextSibling() |
int |
getOrd() |
java.util.Optional<Node> |
getParent()
Returns parent node.
|
java.util.Optional<Node> |
getPrevNode() |
java.util.Optional<Node> |
getPrevSibling() |
Root |
getRoot() |
java.util.List<Node> |
getSiblings() |
java.lang.String |
getUpos() |
java.lang.String |
getXpos() |
int |
hashCode() |
boolean |
isDescendantOf(Node node) |
boolean |
isRoot() |
boolean |
precedes(Node anotherNode) |
void |
remove()
Remove node from the tree.
|
void |
remove(java.util.EnumSet<Node.RemoveArg> args)
Removes node from the tree.
|
void |
setDeprel(java.lang.String deprel) |
void |
setDeps(java.lang.String deps) |
void |
setFeats(java.lang.String feats) |
void |
setForm(java.lang.String form)
Sets form of the node.
|
void |
setHead(java.lang.String head) |
void |
setLemma(java.lang.String lemma) |
void |
setMisc(java.lang.String misc) |
void |
setNextSibling(java.util.Optional<Node> newNextSibling) |
void |
setOrd(int ord) |
void |
setParent(Node parent)
Sets parent.
|
void |
setParent(Node parent,
boolean skipCycles)
Sets parent.
|
void |
setUpos(java.lang.String upos) |
void |
setXpos(java.lang.String xpos) |
void |
shiftAfterNode(Node node)
Shifts node after given node.
|
void |
shiftAfterNode(Node node,
java.util.EnumSet<Node.ShiftArg> args)
Shifts node after given node.
|
void |
shiftAfterSubtree(Node node)
Shifts node with its subtree after given node.
|
void |
shiftAfterSubtree(Node node,
java.util.EnumSet<Node.ShiftArg> args)
Shifts node with its subtree after given node.
|
void |
shiftBeforeNode(Node node)
Shifts node before given node.
|
void |
shiftBeforeNode(Node node,
java.util.EnumSet<Node.ShiftArg> args)
Shifts node before given node.
|
void |
shiftBeforeSubtree(Node node)
Shifts node with its subtree before given node.
|
void |
shiftBeforeSubtree(Node node,
java.util.EnumSet<Node.ShiftArg> args)
Shifts node with its subtree before given node.
|
java.lang.String |
toString() |
protected final Root tree
public DefaultNode(Root tree)
public void remove()
Node
public java.lang.String getAddress()
getAddress
in interface Node
public void remove(java.util.EnumSet<Node.RemoveArg> args)
Node
public Root getRoot()
public Bundle getBundle()
public Document getDocument()
getDocument
in interface Node
public java.util.List<Node> getDescendantsF()
public Node createChild()
Node
createChild
in interface Node
protected Node createNode()
public java.util.List<Node> getChildren(java.util.EnumSet<Node.ChildrenArg> args)
Node
getChildren
in interface Node
args
- args to augment resulting collectionpublic java.util.List<Node> getChildren()
Node
getChildren
in interface Node
public java.util.Optional<Node> getParent()
Node
public void setParent(Node parent, boolean skipCycles)
Node
public boolean isRoot()
public java.util.List<Node> getDescendants(java.util.EnumSet<Node.DescendantsArg> args, Node except)
getDescendants
in interface Node
args
- args to augment resulting collectionexcept
- the resulting collection without this nodepublic java.util.List<Node> getDescendants(java.util.EnumSet<Node.DescendantsArg> args)
getDescendants
in interface Node
args
- args to augment resulting collectionpublic java.util.List<Node> getDescendants()
getDescendants
in interface Node
protected java.util.List<Node> getDescendantsInner(java.util.EnumSet<Node.DescendantsArg> args, java.util.Optional<Node> except)
public java.util.List<Node> getSiblings()
getSiblings
in interface Node
public java.util.Optional<Node> getPrevSibling()
getPrevSibling
in interface Node
public java.util.Optional<Node> getNextSibling()
getNextSibling
in interface Node
public void setNextSibling(java.util.Optional<Node> newNextSibling)
setNextSibling
in interface Node
newNextSibling
- set new next siblingpublic java.util.Optional<Node> getNextNode()
getNextNode
in interface Node
public java.util.Optional<Node> getPrevNode()
getPrevNode
in interface Node
public boolean isDescendantOf(Node node)
isDescendantOf
in interface Node
node
- node we want to find out if there is descendat relationpublic void shiftAfterNode(Node node)
Node
shiftAfterNode
in interface Node
node
- node to shift afterpublic void shiftAfterNode(Node node, java.util.EnumSet<Node.ShiftArg> args)
Node
shiftAfterNode
in interface Node
node
- node to shift afterargs
- args to augment resulting collectionpublic void shiftBeforeNode(Node node)
Node
shiftBeforeNode
in interface Node
node
- node to shift beforepublic void shiftBeforeNode(Node node, java.util.EnumSet<Node.ShiftArg> args)
Node
shiftBeforeNode
in interface Node
node
- node to shift beforeargs
- args to augment resulting collectionpublic void shiftBeforeSubtree(Node node)
Node
shiftBeforeSubtree
in interface Node
node
- node to shift beforepublic void shiftBeforeSubtree(Node node, java.util.EnumSet<Node.ShiftArg> args)
Node
shiftBeforeSubtree
in interface Node
node
- node to shift beforeargs
- args to augment resulting collectionpublic void shiftAfterSubtree(Node node)
Node
shiftAfterSubtree
in interface Node
node
- node to shift afterpublic void shiftAfterSubtree(Node node, java.util.EnumSet<Node.ShiftArg> args)
Node
shiftAfterSubtree
in interface Node
node
- node to shift afterargs
- args to augment resulting collectionpublic boolean precedes(Node anotherNode)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setOrd(int ord)
public java.lang.String getForm()
public void setForm(java.lang.String form)
Node
public java.lang.String getLemma()
public void setLemma(java.lang.String lemma)
public java.lang.String getUpos()
public void setUpos(java.lang.String upos)
public java.lang.String getXpos()
public void setXpos(java.lang.String xpos)
public java.lang.String getFeats()
public void setFeats(java.lang.String feats)
public java.lang.String getHead()
public void setHead(java.lang.String head)
public java.lang.String getDeprel()
public void setDeprel(java.lang.String deprel)
public java.lang.String getDeps()
public void setDeps(java.lang.String deps)
public java.lang.String getMisc()
public void setMisc(java.lang.String misc)
public java.lang.String toString()
toString
in class java.lang.Object