rdr.core
Class Node

java.lang.Object
  extended by rdr.core.Node
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BinaryTreeNode, NTreeNode

public abstract class Node
extends java.lang.Object
implements java.io.Serializable

An abstract Node class When implementing a Node style object for a particular method, extend this if at all possible.

Author:
Ivan Bindoff
See Also:
Serialized Form

Field Summary
 Classification classification
           
 int id
           
 Rule rule
           
 
Constructor Summary
Node(int id)
          Instanciate a node - auto sets the next nodeID
 
Method Summary
 Classification getClassification()
           
abstract  int getDepth()
          Returns the depth of a branch of the knowledge base.
 int getId()
          Fetch the node's id
abstract  int getNumChildren()
           
 Rule getRule()
           
 void setClassification(Classification c)
          Set the node's classification
 void setId(int id)
          Set the node's id WARNING: If you use this method you might upset the node numbering and thus indexing.
 void setRule(Rule r)
          Set the node's rule
 java.lang.String toString()
          Convert the node to readable text
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classification

public Classification classification

rule

public Rule rule

id

public int id
Constructor Detail

Node

public Node(int id)
Instanciate a node - auto sets the next nodeID

Method Detail

getClassification

public Classification getClassification()
Returns:
the classification of this node

getRule

public Rule getRule()
Returns:
the rule of this node

toString

public java.lang.String toString()
Convert the node to readable text

Overrides:
toString in class java.lang.Object

setClassification

public void setClassification(Classification c)
Set the node's classification

Parameters:
c - the classification

setRule

public void setRule(Rule r)
Set the node's rule

Parameters:
r - the rule

getId

public int getId()
Fetch the node's id

Returns:
id

setId

public void setId(int id)
Set the node's id WARNING: If you use this method you might upset the node numbering and thus indexing.

Parameters:
id - the id

getDepth

public abstract int getDepth()
Returns the depth of a branch of the knowledge base. This should be overriden.

Returns:
the depth of the branch

getNumChildren

public abstract int getNumChildren()