ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.rules
Class AbleTree

java.lang.Object
  extended bycom.ibm.able.rules.AbleTree
All Implemented Interfaces:
java.io.Serializable

public class AbleTree
extends java.lang.Object
implements java.io.Serializable

This class represents a decision tree (or table) comprised of condition nodes, case edges, and action (leaf) nodes.

See Also:
Serialized Form

Field Summary
protected  AbleTreeNode rootNode
           
protected  java.util.Vector sharedActionTerms
           
protected  java.util.Hashtable sharedActionTermsTable
           
protected  java.util.Vector sharedConditions
           
protected  java.util.Hashtable sharedConditionsTable
           
protected  boolean symmetric
           
protected static boolean SYMMETRIC_EDEFAULT
           
 
Constructor Summary
AbleTree()
          Create an empty AbleTree.
AbleTree(AbleTreeNode newRootNode, java.util.Vector newSharedConditions, java.util.Vector newSharedActionTerms)
          Create a new AbleTree (decision tree or table) with specified rootnode and shared conditions and action terms.
 
Method Summary
 void addSharedActionTerm(AbleTreePartialExpression newSharedActionTerm)
          Add a single shared action term so that it can be referenced by nodes/edges in this tree.
 void addSharedActionTerms(java.util.Vector newSharedActionTerms)
          Add a list of shared action terms that are referenced by nodes/edges in this tree.
 void addSharedCondition(AbleTreeCondition newSharedCondition)
          Add a single shared condition which can be referenced by nodes/edges in this tree.
 void addSharedConditions(java.util.Vector newSharedConditions)
          Append additional shared conditions referenced by nodes/edges in this tree.
 java.lang.String arlString()
           
 java.lang.String armlString()
           
 void convertToRules()
          Take an ARML table/tree model and convert it into a set of if/then rules.
 AbleTreeNode getRootNode()
          Get the root node in this decision tree/table.
 java.util.Vector getSharedActionTerms()
          Retrieve the list of shared action terms (if any).
 java.util.Vector getSharedConditions()
          Get the shared conditions (if any).
 boolean isEmpty()
          Returns true if the rootNode is null.
 boolean isSymmetric()
          Retrieve value of symmetric flag.
 AbleTreePartialExpression resolveSharedActionTermRef(java.lang.String theUid)
          Given a uid string, return a PartialExpression defined as part of a shared action term.
 AbleTreePartialExpression resolveSharedConditionRef(java.lang.String theUid)
          Given a uid string, return a PartialExpression defined as part of a shared condition.
 void setRootNode(AbleTreeNode newRootNode)
          Set the root node in this decision tree/table.
 void setSharedActionTerms(java.util.Vector newSharedActionTerms)
          Set the list of shared action terms references by nodes/edges in this tree.
 void setSharedConditions(java.util.Vector newSharedConditions)
          Set the list of shared conditions referenced by nodes/edges in this tree.
 void setSymmetric(boolean newSymmetric)
          Set value of symmetric flag.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYMMETRIC_EDEFAULT

protected static final boolean SYMMETRIC_EDEFAULT
See Also:
Constant Field Values

symmetric

protected boolean symmetric

sharedConditions

protected java.util.Vector sharedConditions

sharedConditionsTable

protected java.util.Hashtable sharedConditionsTable

sharedActionTerms

protected java.util.Vector sharedActionTerms

sharedActionTermsTable

protected java.util.Hashtable sharedActionTermsTable

rootNode

protected AbleTreeNode rootNode
Constructor Detail

AbleTree

public AbleTree()
Create an empty AbleTree.


AbleTree

public AbleTree(AbleTreeNode newRootNode,
                java.util.Vector newSharedConditions,
                java.util.Vector newSharedActionTerms)
Create a new AbleTree (decision tree or table) with specified rootnode and shared conditions and action terms.

Parameters:
newRootNode -
newSharedConditions -
newSharedActionTerms -
Method Detail

isSymmetric

public boolean isSymmetric()
Retrieve value of symmetric flag.

Returns:
True if the tree is symmetric.

setSymmetric

public void setSymmetric(boolean newSymmetric)
Set value of symmetric flag.

Parameters:
newSymmetric -

getSharedConditions

public java.util.Vector getSharedConditions()
Get the shared conditions (if any).

Returns:
The list of shared conditions.

setSharedConditions

public void setSharedConditions(java.util.Vector newSharedConditions)
Set the list of shared conditions referenced by nodes/edges in this tree.

Parameters:
newSharedConditions - The list of shared conditions.

addSharedConditions

public void addSharedConditions(java.util.Vector newSharedConditions)
Append additional shared conditions referenced by nodes/edges in this tree.

Parameters:
newSharedConditions -

addSharedCondition

public void addSharedCondition(AbleTreeCondition newSharedCondition)
Add a single shared condition which can be referenced by nodes/edges in this tree.

Parameters:
newSharedCondition -

resolveSharedConditionRef

public AbleTreePartialExpression resolveSharedConditionRef(java.lang.String theUid)
Given a uid string, return a PartialExpression defined as part of a shared condition. Used by parser.

Parameters:
theUid -
Returns:
The resolved expression.

resolveSharedActionTermRef

public AbleTreePartialExpression resolveSharedActionTermRef(java.lang.String theUid)
Given a uid string, return a PartialExpression defined as part of a shared action term. Used by parser.

Parameters:
theUid -
Returns:
The resolved expression.

getSharedActionTerms

public java.util.Vector getSharedActionTerms()
Retrieve the list of shared action terms (if any).

Returns:
The list.

setSharedActionTerms

public void setSharedActionTerms(java.util.Vector newSharedActionTerms)
Set the list of shared action terms references by nodes/edges in this tree.

Parameters:
newSharedActionTerms -

addSharedActionTerms

public void addSharedActionTerms(java.util.Vector newSharedActionTerms)
Add a list of shared action terms that are referenced by nodes/edges in this tree.

Parameters:
newSharedActionTerms -

addSharedActionTerm

public void addSharedActionTerm(AbleTreePartialExpression newSharedActionTerm)
Add a single shared action term so that it can be referenced by nodes/edges in this tree.

Parameters:
newSharedActionTerm -

getRootNode

public AbleTreeNode getRootNode()
Get the root node in this decision tree/table.

Returns:
the root node

setRootNode

public void setRootNode(AbleTreeNode newRootNode)
Set the root node in this decision tree/table.

Parameters:
newRootNode -

isEmpty

public boolean isEmpty()
Returns true if the rootNode is null.

Returns:
True if the rootNode is null.

convertToRules

public void convertToRules()
Take an ARML table/tree model and convert it into a set of if/then rules.


arlString

public java.lang.String arlString()

armlString

public java.lang.String armlString()

toString

public java.lang.String toString()

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005