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 Type
    Method
    Description
    void
    Append a child to this node.
    Get the children of the node.
    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
    setNext(INode next)
    Set the sibling node immediately following the specified node.
    void
    setParent(INode parent)
    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

      void setParent(INode parent)
      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

      void setPrevious(INode previous)
      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

      void setNext(INode next)
      Set the sibling node immediately following the specified node.
      Parameters:
      next - the sibling node immediately following the specified node.
    • appendChild

      void appendChild(INode child)
      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.