rdr.methods
Class BinaryTreeNode

java.lang.Object
  extended by rdr.core.Node
      extended by rdr.methods.BinaryTreeNode
All Implemented Interfaces:
java.io.Serializable

public class BinaryTreeNode
extends Node

A binary tree node object. Designed for use with single classification RDR - SCRDR.java Based on specification by Compton and Jansen.

Author:
Ivan Bindoff
See Also:
Serialized Form

Field Summary
 
Fields inherited from class rdr.core.Node
classification, id, rule
 
Constructor Summary
BinaryTreeNode(Rule rule, Classification classification, Case cornerstone)
          Construct a Binary Tree Node
 
Method Summary
 Case getCornerstone()
           
 int getDepth()
          Finds the depth of this node
 BinaryTreeNode getFalseBranch()
           
 int getNumChildren()
           
 BinaryTreeNode getTrueBranch()
           
 void setCornerstone(Case c)
          Set the cornerstone to the case c
 void setFalse(BinaryTreeNode n)
           
 void setTrue(BinaryTreeNode n)
           
 
Methods inherited from class rdr.core.Node
getClassification, getId, getRule, setClassification, setId, setRule, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryTreeNode

public BinaryTreeNode(Rule rule,
                      Classification classification,
                      Case cornerstone)
Construct a Binary Tree Node

Method Detail

setTrue

public void setTrue(BinaryTreeNode n)
Parameters:
n - the node to use as the true branch

setFalse

public void setFalse(BinaryTreeNode n)
Parameters:
n - the node to use as the false branch

getTrueBranch

public BinaryTreeNode getTrueBranch()
Returns:
the reference to the true branch

getFalseBranch

public BinaryTreeNode getFalseBranch()
Returns:
the reference to the false branch

getCornerstone

public Case getCornerstone()
Returns:
the cornerstone case for this node

setCornerstone

public void setCornerstone(Case c)
Set the cornerstone to the case c

Parameters:
c -

getDepth

public int getDepth()
Finds the depth of this node

Specified by:
getDepth in class Node
Returns:
depth

getNumChildren

public int getNumChildren()
Specified by:
getNumChildren in class Node
Returns:
the number of children this node has.