# Class Node

java.lang.Object
org.apache.cayenne.access.sqlbuilder.sqltree.Node

Direct Known Subclasses:
  `AliasedNode, CaseNode, ColumnNode, ConvertNode, DeleteNode, DistinctNode, ElseNode, EmptyNode, ExistsNode, ExpressionNode, FirebirdLimitNode, FromNode, FunctionNode, GroupByNode, HavingNode, InNode, InsertColumnsNode, InsertNode, InsertValuesNode, JoinNode, LimitOffsetNode, NegateNode, NotNode, OffsetNode, OrderByNode, PostgresExtractFunctionNode, SelectNode, SelectResultNode, SubqueryNode, TableNode, TextNode, ThenNode, TopNode, TrimmingColumnNode, UpdateNode, UpdateSetNode, ValueNode, WhenNode, WhereNode`

public abstract class Node extends Object

Since:
  4.2

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Node[]`
  `children`
  `protected int`
  `childrenCount`
  `protected Node`
  `parent`
  `protected final NodeType`
  `type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Node()`
  `Node(NodeType type)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `addChild(int index, Node node)`
  `Node`
  `addChild(Node node)`
  `abstract SQLAppendable`
  `append(SQLAppendable buffer, SQLGenerationContext context)`
  `void`
  `appendChildrenEnd(SQLAppendable buffer)`
  `void`
  `appendChildrenSeparator(SQLAppendable buffer, int childInd)`
  `void`
  `appendChildrenStart(SQLAppendable buffer)`
  `abstract Node`
  `copy()`
  `<T extends Node>
  T`
  `deepCopy()`
  `boolean`
  `deepEquals(Node node)`
  `boolean`
  `equals(Object o)`
  `Node`
  `getChild(int idx)`
  `int`
  `getChildrenCount()`
  `Node`
  `getParent()`
  `NodeType`
  `getType()`
  `int`
  `hashCode()`
  `void`
  `replaceChild(int idx, Node node)`
  `void`
  `setParent(Node parent)`
  `String`
  `toString()`
  `void`
  `visit(NodeTreeVisitor visitor)`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### parent

    protected Node parent

  - ### children

    protected Node[] children

  - ### childrenCount

    protected int childrenCount

  - ### type

    protected final NodeType type

- ## Constructor Details

  - ### Node

    public Node(NodeType type)

  - ### Node

    public Node()

- ## Method Details

  - ### addChild

    public Node addChild(int index, Node node)

  - ### addChild

    public Node addChild(Node node)

  - ### getChild

    public Node getChild(int idx)

  - ### getChildrenCount

    public int getChildrenCount()

  - ### replaceChild

    public void replaceChild(int idx, Node node)

  - ### getParent

    public Node getParent()

  - ### setParent

    public void setParent(Node parent)

  - ### visit

    public void visit(NodeTreeVisitor visitor)

  - ### deepCopy

    public <T extends Node> T deepCopy()
    Returns:
      deep copy(i.e. with copies of all children) of this node

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getType

    public NodeType getType()

  - ### copy

    public abstract Node copy()

  - ### append

    public abstract SQLAppendable append(SQLAppendable buffer, SQLGenerationContext context)

  - ### appendChildrenSeparator

    public void appendChildrenSeparator(SQLAppendable buffer, int childInd)

  - ### appendChildrenStart

    public void appendChildrenStart(SQLAppendable buffer)

  - ### appendChildrenEnd

    public void appendChildrenEnd(SQLAppendable buffer)

  - ### deepEquals

    public boolean deepEquals(Node node)
    Parameters:
      `node` - to compare with
    Returns:
      true if this node and all it's children are equal to the given node
    Since:
      5.0

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`