weka.filters.supervised.attribute.gpattributegeneration
Class GeneNode<T>

java.lang.Object
  extended by weka.filters.supervised.attribute.gpattributegeneration.Node<T>
      extended by weka.filters.supervised.attribute.gpattributegeneration.GeneNode<T>

public class GeneNode<T>
extends Node<T>

Node type for Genes. Ported from C#.

Author:
Luke Devonshire & Colin Noakes

Constructor Summary
GeneNode()
          Creates an empty node
GeneNode(T data)
          Creates a gene node with the given data
GeneNode(T data, GeneNode<T> left, GeneNode<T> right)
          Creates a gene node
 
Method Summary
 void add(GeneNode<T> node)
          add a child to the node (up to a maximum of 2)
 GeneNode<T> getLeft()
          Get Left child
 GeneNode<T> getParent()
          Gets the node's parent
 GeneNode<T> getRight()
          Get Right child
 void setParent(GeneNode<T> parent)
          Set the parent
 java.lang.String toString()
          Converts node to a string
 
Methods inherited from class weka.filters.supervised.attribute.gpattributegeneration.Node
getChildren, getValue, setChildren, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GeneNode

public GeneNode()
Creates an empty node


GeneNode

public GeneNode(T data)
Creates a gene node with the given data

Parameters:
data - data to pass to the node

GeneNode

public GeneNode(T data,
                GeneNode<T> left,
                GeneNode<T> right)
Creates a gene node

Parameters:
data - data to pass to the node
left - left child
right - right child
Method Detail

add

public void add(GeneNode<T> node)
add a child to the node (up to a maximum of 2)

Parameters:
node - Node to add to the current node as a child

getLeft

public GeneNode<T> getLeft()
Get Left child

Returns:
The left child of the node

getRight

public GeneNode<T> getRight()
Get Right child

Returns:
The right child of the node

getParent

public GeneNode<T> getParent()
Gets the node's parent

Returns:
The parent

setParent

public void setParent(GeneNode<T> parent)
Set the parent

Parameters:
parent - Parent to set

toString

public java.lang.String toString()
Converts node to a string

Overrides:
toString in class java.lang.Object
Returns:
The node as a string