TreeNode
Keywords: uk.ac.bbk.dcs.automed.graph.TreeNode,TreeNode class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.bbk.dcs.automed.graph
Class TreeNode

    java.lang.Object
      |
      +--uk.ac.bbk.dcs.automed.graph.TreeNode

public class TreeNode
extends java.lang.Object

Class that abstracts the node of a tree structure.

IMPORTANT: at the moment, the children of a tree node are a set and not a list.

Author:
  Lucas Zamboulis

Constructor Summary
`protected` | `TreeNode(java.lang.String name)`

Method Summary
`protected void` | `addChild(TreeNode t)` Adds a node to the set of children of the node
`java.util.HashSet` | `getChildren()`
`java.lang.String` | `getName()`
`TreeNode` | `getParent()`
`protected boolean` | `isLeaf()`
`boolean` | `isRoot()`
`protected void` | `setChildren(java.util.HashSet s)` Sets the children of the node.
`protected void` | `setParent(TreeNode n)` Sets the parent node.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TreeNode

    protected TreeNode(java.lang.String name)

Parameters:
  `name` - the name of the node

Method Detail

### setParent

    protected void setParent(TreeNode n)

  Sets the parent node.

  Parameters:
    `n` - the parent node

### isRoot

    public boolean isRoot()

  Returns:
    true if the node is a root node, false otherwise

### isLeaf

    protected boolean isLeaf()

  Returns:
    true if the node is a leaf node, false otherwise

### getParent

    public TreeNode getParent()

  Returns:
    the parent node

### getChildren

    public java.util.HashSet getChildren()

  Returns:
    the set of children of the node

### setChildren

    protected void setChildren(java.util.HashSet s)

  Sets the children of the node.

  Parameters:
    `s` - the set of children

### addChild

    protected void addChild(TreeNode t)

  Adds a node to the set of children of the node

  Parameters:
    `t` - the node to add in the set of children

### getName

    public java.lang.String getName()

  Returns:
    the name of the node

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD