core

## Class Node

- java.lang.Object
- - core.Node

-     public class Node
      extends java.lang.Object

  Created with IntelliJ IDEA. User: Diego Date: 04/10/13 Time: 16:34 This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.util.ArrayList<Node>` | `children` Children of this node.
    `Content` | `content` Contents of this node.
    `int` | `indent` Indent of the node in the tree.
    `Node` | `parent` Parent of this node.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Node(java.lang.String contentLine, int indent, Node parent, int set)` Constructor of the node.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Node` | `getRoot()` Returns the root of the tree structure
    `void` | `insert(Node node)` Inserts a new node in the tree structure.
    `java.lang.String` | `toString()` Parses the node and children to a String for debug and printing.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### parent

          public Node parent

      Parent of this node.

    - #### content

          public Content content

      Contents of this node.

    - #### indent

          public int indent

      Indent of the node in the tree.

    - #### children

          public java.util.ArrayList<Node> children

      Children of this node.

  - ### Constructor Detail

    - #### Node

          public Node(java.lang.String contentLine,
              int indent,
              Node parent,
              int set)

      Constructor of the node.
      Parameters:
        `contentLine` - string with the node information
        `indent` - indent level of this node, to determine its place on the tree.
        `parent` - indicates the parent of the new node, if any.

  - ### Method Detail

    - #### insert

          public void insert(Node node)

      Inserts a new node in the tree structure. Navigates from this node up towards the root, inserting the new node at the correct indent.
      Parameters:
        `node` - new node to add.

    - #### toString

          public java.lang.String toString()

      Parses the node and children to a String for debug and printing.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        representative String

    - #### getRoot

          public Node getRoot()

      Returns the root of the tree structure
      Returns:
        the root