Interface INode
public interface INode
Tree interface.
implement memory management policy. The node may exist in disk or keep in the
memory.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendChild
(INode child) Append a child to this node.Get the children of the node.getNext()
Get the sibling node immediately following the specified node.Get the parent of the node, or return null if the node is in tree top level.Get the sibling node immediately preceding the specified node.void
Remove all children of the node.void
Set the sibling node immediately following the specified node.void
Set the parent of the node.void
setPrevious
(INode previous) Set the sibling node immediately preceding the specified node.
-
Method Details
-
getParent
INode getParent()Get the parent of the node, or return null if the node is in tree top level.- Returns:
- the parent of the node.
-
setParent
Set the parent of the node.- Parameters:
parent
- the parent of the node.
-
getPrevious
INode getPrevious()Get the sibling node immediately preceding the specified node.- Returns:
- the sibling node immediately preceding the specified node.
-
setPrevious
Set the sibling node immediately preceding the specified node.- Parameters:
previous
- the sibling node immediately preceding the specified node.
-
getNext
INode getNext()Get the sibling node immediately following the specified node.- Returns:
- the sibling node immediately following the specified node.
-
setNext
Set the sibling node immediately following the specified node.- Parameters:
next
- the sibling node immediately following the specified node.
-
appendChild
Append a child to this node.- Parameters:
child
- the child need to be appended.
-
getChildren
Iterator getChildren()Get the children of the node.- Returns:
- the children of the node.
-
removeChildren
void removeChildren()Remove all children of the node.
-