rdr.methods
Class BinaryTreeNode
java.lang.Object
rdr.core.Node
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
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BinaryTreeNode
public BinaryTreeNode(Rule rule,
Classification classification,
Case cornerstone)
- Construct a Binary Tree Node
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.