org.primordion.xholon.base
Class XholonClass

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonClass
All Implemented Interfaces:
IXholon, IXholonClass
Direct Known Subclasses:
BioXholonClass

public class XholonClass
extends Xholon
implements IXholonClass

A XholonClass is a concrete subclass of Xholon. A primary role of a XholonClass instance is to provide configuration instructions for Xholon instances of its type.

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

Field Summary
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.xholon.base.IXholonClass
MTYPE_MASK, MtypeActivity, MtypeBraneCalcEntity, MtypeComposition, MtypeConfigContainer, MtypeCtrnnEntity, MtypeGridEntity, MtypeMemCompEntity, MtypePort, MtypeStateMachineEntity, XhtypeActivity, XhtypeBehFgsCon, XhtypeBehFgsxxx, XhtypeBehxxxCon, XhtypeBehxxxxxx, XhtypeBraneCalcEntity, XhtypeBraneCalcEntityActive, XhtypeBraneCalcEntityPassive, XhtypeConfigContainer, XhtypeCtrnnEntity, XhtypeCtrnnEntityActive, XhtypeCtrnnEntityActivePassive, XhtypeGridEntity, XhtypeGridEntityActive, XhtypeGridEntityActivePassive, XhtypeMemCompEntity, XhtypeMemCompEntityActive, XhtypeMemCompEntityActiveContainer, XhtypeMemCompEntityPassive, XhtypeNone, XhtypePort, XhtypePureActiveObject, XhtypePureContainer, XhtypePurePassiveObject, XhtypeStateMachineEntity, XhtypeStateMachineEntityActive, XhtypexxxFgsCon, XhtypexxxFgsxxx, XhtypexxxxxxCon, Xhtypexxxxxxxxx
 
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
XholonClass()
          Constructor.
 
Method Summary
 void configure()
          Perform some action, typically once at start up; MAY be overridden.
static XholonClass getClassNode(int id)
          Get an instance of XholonClass, given its numeric id.
static XholonClass getClassNode(java.lang.String cName)
          Get an instance of XholonClass, given its name.
 java.lang.String getConfigurationInstructions()
          Get configuration instructions.
 java.lang.String getImplName()
          Get the name of the Java class that implements this Xholon class.
static IInheritanceHierarchy getInherHier()
          Get inheritance hierarchy.
static java.lang.String getMechanismName(int mType)
          Get the printable name of a mechanism (formalism), given its type.
static int getMechanismType(int xhType)
          Get the mechanism (formalism) type that implements this Xholon class.
 java.lang.String getName()
          Get name, unique within this application, of this Xholon instance.
static int getNextId()
          Get the next available id for assignment to an instance of XholonClass.
 int getXhType()
          Get xholon type.
static java.lang.String getXhTypeName(int xhType)
          Get the printable name
 boolean hasAncestor(java.lang.String tnName)
          Does this instance of XholonClass have the specified ancestor somewhere in its inheritance tree.
 void initialize()
          Initialize the tree node.
 void inOrderPrint(int level)
          In-order print.
 boolean isActiveObject()
          Is this xholon or xholon class an Active Object?
 boolean isContainer()
          Is this xholon or xholon class a Container?
 boolean isPassiveObject()
          Is this xholon or xholon class a Passive Object?
 void postOrderPrint(int level)
          Post-order print.
 void preOrderPrint(int level)
          Pre-order print.
 void printNode(int level)
          Called by the various xOrderPrint() routines.
static void resetNextId()
          Set the next available id back to 0.
 void setImplName(java.lang.String implName)
          Set the name of the Java class that implements this Xholon class.
static void setInherHier(IInheritanceHierarchy iHier)
          Set inheritance hierarchy.
 void setName(java.lang.String className)
          Set name of this XholonClass.
 void setNavInfo(java.lang.String navInfo)
          Set navigation information.
 void setXhType(int xhType)
          Set xholon type.
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.Xholon
act, appendChild, appendChild, appendChild, cleanup, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getNeighbors, 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, handleNodeSelection, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, insertAfter, insertBefore, insertFirstChild, isBound, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postReconfigure, preAct, preConfigure, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, 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, 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, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, 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, handleNodeSelection, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, insertAfter, insertBefore, insertFirstChild, isBound, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postReconfigure, preAct, preConfigure, 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
 

Constructor Detail

XholonClass

public XholonClass()
Constructor.

Method Detail

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class Xholon

setInherHier

public static void setInherHier(IInheritanceHierarchy iHier)
Set inheritance hierarchy.

Parameters:
iHier - The singleton instanced of InheritanceHierarchy.

getInherHier

public static IInheritanceHierarchy getInherHier()
Get inheritance hierarchy.

Returns:
The singleton instance of InheritanceHierarchy.

getClassNode

public static XholonClass getClassNode(java.lang.String cName)
Get an instance of XholonClass, given its name.

Parameters:
cName - Name of the XholonClass (ex: "HelloWorld").
Returns:
An instance of XholonClass, or null.

getClassNode

public static XholonClass getClassNode(int id)
Get an instance of XholonClass, given its numeric id.

Returns:
An instance of XholonClass, or null.

getNextId

public static int getNextId()
Get the next available id for assignment to an instance of XholonClass.

Returns:
A unique ID.

resetNextId

public static void resetNextId()
Set the next available id back to 0. This should only be called when loading a new model in, to replace an existing one.


getName

public java.lang.String getName()
Description copied from interface: IXholon
Get name, unique within this application, of this Xholon instance. The name is a concatenation of the IXholonClass name and the Xholon unique ID. The first letter is converted to lowercase, and a "_" is used to separate the name and ID. ex: "helloWorld_123"

Specified by:
getName in interface IXholon
Overrides:
getName in class Xholon

setName

public void setName(java.lang.String className)
Description copied from interface: IXholonClass
Set name of this XholonClass.

Specified by:
setName in interface IXholonClass
Parameters:
className - The new name.

setNavInfo

public void setNavInfo(java.lang.String navInfo)
Description copied from interface: IXholonClass
Set navigation information.

Specified by:
setNavInfo in interface IXholonClass
Parameters:
navInfo - A configuration string describing ports, attributes and commands for this XholonClass and its Xholon instances.

getXhType

public int getXhType()
Description copied from interface: IXholonClass
Get xholon type. (ex: XhtypePureContainer, XhtypePurePassiveObject, XhtypePureActiveObject)

Specified by:
getXhType in interface IXholonClass
Overrides:
getXhType in class Xholon

setXhType

public void setXhType(int xhType)
Description copied from interface: IXholonClass
Set xholon type.

Specified by:
setXhType in interface IXholonClass
Parameters:
xhType - The new Xholon type. (ex: XhtypePureContainer, XhtypePurePassiveObject, XhtypePureActiveObject)

isContainer

public boolean isContainer()
Description copied from interface: IXholon
Is this xholon or xholon class a Container?

Specified by:
isContainer in interface IXholon
Overrides:
isContainer in class Xholon

isActiveObject

public boolean isActiveObject()
Description copied from interface: IXholon
Is this xholon or xholon class an Active Object?

Specified by:
isActiveObject in interface IXholon
Overrides:
isActiveObject in class Xholon

isPassiveObject

public boolean isPassiveObject()
Description copied from interface: IXholon
Is this xholon or xholon class a Passive Object?

Specified by:
isPassiveObject in interface IXholon
Overrides:
isPassiveObject in class Xholon

getImplName

public java.lang.String getImplName()
Description copied from interface: IXholonClass
Get the name of the Java class that implements this Xholon class.

ex: org.primordion.user.app.APartOfTheSystem

Specified by:
getImplName in interface IXholonClass
Returns:
The full package name of a Java class, or null if the name is unknown.

setImplName

public void setImplName(java.lang.String implName)
Description copied from interface: IXholonClass
Set the name of the Java class that implements this Xholon class.

ex: org.primordion.user.app.APartOfTheSystem

Specified by:
setImplName in interface IXholonClass
Parameters:
implName - The full package name of a Java class.

getXhTypeName

public static java.lang.String getXhTypeName(int xhType)
Get the printable name

Returns:
A printable name.

getMechanismType

public static int getMechanismType(int xhType)
Get the mechanism (formalism) type that implements this Xholon class. This usually corresponds with a specific Java class.

Parameters:
xhType - The Xholon type.
Returns:
The mechanism type.

getMechanismName

public static java.lang.String getMechanismName(int mType)
Get the printable name of a mechanism (formalism), given its type.

Parameters:
mType - The mechanism type.
Returns:
A user-friendly displayable name.

hasAncestor

public boolean hasAncestor(java.lang.String tnName)
Description copied from interface: IXholonClass
Does this instance of XholonClass have the specified ancestor somewhere in its inheritance tree.

Specified by:
hasAncestor in interface IXholonClass
Overrides:
hasAncestor in class Xholon

configure

public void configure()
Description copied from interface: IXholon
Perform some action, typically once at start up; MAY be overridden. Recursive; application should call this only for root.

Specified by:
configure in interface IXholon
Overrides:
configure in class Xholon

getConfigurationInstructions

public java.lang.String getConfigurationInstructions()
Description copied from interface: IXholonClass
Get configuration instructions.

Specified by:
getConfigurationInstructions in interface IXholonClass
Returns:
The instructions.

preOrderPrint

public void preOrderPrint(int level)
Description copied from interface: IXholon
Pre-order print. Print current node; then traverse children and siblings.

Specified by:
preOrderPrint in interface IXholonClass
Overrides:
preOrderPrint in class Xholon

inOrderPrint

public void inOrderPrint(int level)
Description copied from interface: IXholon
In-order print. Traverse children; then print current node; then traverse siblings.

Specified by:
inOrderPrint in interface IXholonClass
Overrides:
inOrderPrint in class Xholon

postOrderPrint

public void postOrderPrint(int level)
Description copied from interface: IXholon
Post-order print. Traverse children and siblings; then print current node.

Specified by:
postOrderPrint in interface IXholonClass
Overrides:
postOrderPrint in class Xholon

printNode

public void printNode(int level)
Called by the various xOrderPrint() routines.

Parameters:
level - The current level in the composite structure hierarchy tree.

toString

public java.lang.String toString()
Overrides:
toString in class Xholon