Interface Node

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void accept​(Visitor visitor)
      Accept the visitor and allow it to perform actions on this Node.
      <T extends Node>
      T
      copy​(java.lang.Class<T> cls)
      Make a deep copy of this node.
      <T extends Node>
      T
      copy​(Node newParent, java.lang.Class<T> cls)
      Copy setting a new parent in the result.
      <T extends Node>
      T
      getAncestor​(java.lang.Class<T> type)
      Return the first ancestor of this node of the given type, if any.
      int id()
      Return the unique ID of this node.
      Node parent()
      Return the Node that contains (and created) this Node.
      void parent​(Node node)
      Set the parent to a new value.
    • Method Detail

      • parent

        Node parent()
        Return the Node that contains (and created) this Node.
      • id

        int id()
        Return the unique ID of this node. This starts at 1 and is incremented for each new Node that is created.
      • parent

        void parent​(Node node)
        Set the parent to a new value. Should only be called inside NodeBase.
      • getAncestor

        <T extends Node> T getAncestor​(java.lang.Class<T> type)
        Return the first ancestor of this node of the given type, if any. Throws IllegalArgumentException if not found.
      • copy

        <T extends Node> T copy​(java.lang.Class<T> cls)
        Make a deep copy of this node. If nn = n.copy(), then n.parent() == nn.parent(), which also means that the parent is NOT copied.
      • copy

        <T extends Node> T copy​(Node newParent,
                                java.lang.Class<T> cls)
        Copy setting a new parent in the result.
      • accept

        void accept​(Visitor visitor)
        Accept the visitor and allow it to perform actions on this Node.