org.primordion.xholon.base
Class InheritanceHierarchy

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.InheritanceHierarchy
All Implemented Interfaces:
IInheritanceHierarchy, IXholon

public class InheritanceHierarchy
extends Xholon
implements IInheritanceHierarchy

An InheritanceHierarchy represents a hierarchy (tree) of XholonClass nodes that inherit from other XholonClass nodes. It encapsulates the root node of a XholonClass hierarchy (rootNode). Primary roles of the InheritanceHierarchy are: (1) to read a XholonClass hierarchy in from a file (ex: InheritanceHierarchy.xml) and store the nodes in a tree, and (2) to read XholonClass details in from a file (ex: ClassDetails.txt).

Since:
0.1 (Created on Sept 8, 2005)
Author:
Ken Webb

Field Summary
 int searchAlgorithm
           
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.base.IInheritanceHierarchy
CLASSID_NOT_FOUND, EOF, GETCLASSNODE_HASHTABLE, GETCLASSNODE_TREESEARCH, NAVINFO_SEPARATOR, NEXTIDLOCAL_INITIAL
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
InheritanceHierarchy()
           
 
Method Summary
 XholonClass getClassNode(int xhClassId)
          Get reference to a XholonClass node, specified by its numeric ID.
 XholonClass getClassNode(java.lang.String xhClassName)
          Get reference to a XholonClass node, specified by its name.
 XholonClass getTheRootNode()
          Get the root node of the inheritance hierarchy.
static java.lang.String getXincludePath()
          Get parameter XInclude path.
 void populateAttributesFromFile(java.lang.String fileName)
          Populate ports, attributes and other class details from file.
 void populateFromFile(java.lang.String fileName)
          Populate the tree by reading items from a file.
 void printInheritanceHierarchy()
          Print out the XholonClass names, in tree order.
 void setTreeNodeFactory(ITreeNodeFactory f)
          Set singleton TreeNodeFactory.
static void setXincludePath(java.lang.String xiPath)
          Set parameter XInclude path.
 
Methods inherited from class org.primordion.xholon.base.Xholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, toString, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.primordion.xholon.base.IXholon
act, appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, sendMessage, sendMessage, sendMessage, setAttributeVal, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, treeSize, writeXml
 

Field Detail

searchAlgorithm

public int searchAlgorithm
Constructor Detail

InheritanceHierarchy

public InheritanceHierarchy()
Method Detail

setTreeNodeFactory

public void setTreeNodeFactory(ITreeNodeFactory f)
Description copied from interface: IInheritanceHierarchy
Set singleton TreeNodeFactory.

Specified by:
setTreeNodeFactory in interface IInheritanceHierarchy
Parameters:
f - The TreeNodeFactory instance.

setXincludePath

public static void setXincludePath(java.lang.String xiPath)
Set parameter XInclude path.

Parameters:
xiPath - The path ex: "./config/_common/" .

getXincludePath

public static java.lang.String getXincludePath()
Get parameter XInclude path.

Returns:
The path.

getClassNode

public XholonClass getClassNode(int xhClassId)
Description copied from interface: IInheritanceHierarchy
Get reference to a XholonClass node, specified by its numeric ID.

Specified by:
getClassNode in interface IInheritanceHierarchy
Parameters:
xhClassId - The numeric ID.
Returns:
An instance of XholonClass.

getClassNode

public XholonClass getClassNode(java.lang.String xhClassName)
Description copied from interface: IInheritanceHierarchy
Get reference to a XholonClass node, specified by its name.

Specified by:
getClassNode in interface IInheritanceHierarchy
Parameters:
xhClassName - Name of the XholonClass (ex: "HelloWorld").
Returns:
An instance of XholonClass, or null.

getTheRootNode

public XholonClass getTheRootNode()
Description copied from interface: IInheritanceHierarchy
Get the root node of the inheritance hierarchy.

Specified by:
getTheRootNode in interface IInheritanceHierarchy
Returns:
The root node.

populateFromFile

public void populateFromFile(java.lang.String fileName)
Description copied from interface: IInheritanceHierarchy
Populate the tree by reading items from a file.

Specified by:
populateFromFile in interface IInheritanceHierarchy
Parameters:
fileName - The name of the inheritance hierarchy file (ex: InheritanceHierarchy.xml).

populateAttributesFromFile

public void populateAttributesFromFile(java.lang.String fileName)
Description copied from interface: IInheritanceHierarchy
Populate ports, attributes and other class details from file.

Specified by:
populateAttributesFromFile in interface IInheritanceHierarchy
Parameters:
fileName - Name of the file containing the XholonClass details (ex: ClassDetails.xml).

printInheritanceHierarchy

public void printInheritanceHierarchy()
Description copied from interface: IInheritanceHierarchy
Print out the XholonClass names, in tree order.

Specified by:
printInheritanceHierarchy in interface IInheritanceHierarchy