org.primordion.xholon.base
Class XholonWithPorts

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
All Implemented Interfaces:
IXholon
Direct Known Subclasses:
AbstractGrid, ObservableXholonWithPorts, Turtle, Xh__XholonTemplate__, XhAbstractBraneCalc, XhAbstractCtrnn, XhAbstractMemComp, XhAbstractSbml, XhCartCentering, XhCell, XhCellAutop, XhCollisions, XhEcjAntTrail, XhEcjCartCentering, XhEcjTutorial4, XhElevator, XhElevator, XhEpo2, XhFibonacci, XhFsm06ex1_Fsm, XhFsm06ex1_Fsm, XhGeneric, XhGravity1, XhHelloWorld, XhHelloWorld_NoXml, XhHelloWorld_str, XhHelloWorld_TestTime, XhHelloWorldTutorial, XhHelloWorldTutorial, XhHelloWorldTutorial, XhHelloWorldTutorial_multiWorld, XhHelloWorldTutorial_multiWorld, XhHelloWorldTutorial_plus, XhHelloWorldTutorial_universe, XhHelloWorldTutorialSysML, XhInterest, XhLife, XholonTime, XhPingPong, XhProvidedRequiredTest, XhRcs_GP_FSM, XhRcs_GP_FSM_Grid, XhRcs_GP_MM, XhRcs_GP_MM_NoSymbols, XhRcs1, XhRcs2, XhRcsTemp, XhStateMachineOnly, XhStopWatch, XhStupidModel1, XhStupidModel10, XhStupidModel11, XhStupidModel12, XhStupidModel13, XhStupidModel14, XhStupidModel15, XhStupidModel16, XhStupidModel16nl, XhStupidModel2, XhStupidModel3, XhStupidModel4, XhStupidModel5, XhStupidModel5tg, XhStupidModel6, XhStupidModel7, XhStupidModel8, XhStupidModel9, XhTestFsm, XhTestFsm, XhTestFsm, XhTestFsmForkJoin, XhTestFsmHistory, XhTestFsmJunction, XhTestFsmKW, XhTestFsmOrthog, XhTestFsmOrthogKW, XhTestFsmOrthogonal, XhTrain, XhTurtleExample1, XhTutorial4, XhWatch, XhWatch, XhWolfSheepGrass

public abstract class XholonWithPorts
extends Xholon

A Xholon with ports, so it can set up lateral connections with peers. Ports allow dynamic interactions between Xholons at runtime.

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

Field Summary
 IXholon[] port
           
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
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
XholonWithPorts()
          Constructor.
 
Method Summary
 void configure()
          Perform some action, typically once at start up; MAY be overridden.
static int getMaxPorts()
          Get the maximum number of ports for any xholon in the model.
 IXholon getPort(int portNum)
          Get the port that corresponds to this index (0 indexed).
 void initialize()
          Initialize the tree node.
 boolean isActiveObject()
          Is this xholon or xholon class an Active Object?
 boolean isBound(IXholon port)
          Is this port bound to anything? If a port is bound, then it will be possible for the local IXholon to send a message to, or get/set a val on, a remote IXholon.
 boolean isContainer()
          Is this xholon or xholon class a Container?
 boolean isPassiveObject()
          Is this xholon or xholon class a Passive Object?
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
static void setMaxPorts(int mPorts)
          Set the maximum number of ports for any xholon in the model.
 void setPorts()
          Set ports, by creating an array of ports.
 void terminate()
          Terminate a UML2 state machine, and optionally terminate the xholon that owns the state machine.
 
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, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, 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, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, 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, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, toString, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

port

public IXholon[] port
Constructor Detail

XholonWithPorts

public XholonWithPorts()
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

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

setMaxPorts

public static void setMaxPorts(int mPorts)
Set the maximum number of ports for any xholon in the model.

Parameters:
mPorts - Maximum number of ports.

getMaxPorts

public static int getMaxPorts()
Get the maximum number of ports for any xholon in the model.

Returns:
Maximum number of ports.

getPort

public IXholon getPort(int portNum)
Description copied from interface: IXholon
Get the port that corresponds to this index (0 indexed).

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

isBound

public boolean isBound(IXholon port)
Description copied from interface: IXholon
Is this port bound to anything? If a port is bound, then it will be possible for the local IXholon to send a message to, or get/set a val on, a remote IXholon.

If the port is intended to be a direct reference to another IXholon, then isBound() will return true if the port actually references a concrete IXholon, and will return false if the port value is null.

If the port is intended to be an IPort, then isBound() will return true if there is an end-to-end connection to a remote IXholon, and will return false if the port value is null or if it does not connect all the way through to a remote IXholon.

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

setPorts

public void setPorts()
Description copied from interface: IXholon
Set ports, by creating an array of ports. A port is a reference to a Xholon somewhere else in the tree.

Specified by:
setPorts in interface IXholon
Overrides:
setPorts 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

postConfigure

public void postConfigure()
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:
postConfigure in interface IXholon
Overrides:
postConfigure in class Xholon

terminate

public void terminate()
Description copied from interface: IXholon
Terminate a UML2 state machine, and optionally terminate the xholon that owns the state machine. The UML 2.1.1 specification states (section 15.3.8): "Entering a terminate pseudostate implies that the execution of this state machine by means of its context object is terminated. The state machine does not exit any states nor does it perform any exit actions other than those associated with the transition leading to the terminate pseudostate. Entering a terminate pseudostate is equivalent to invoking a DestroyObjectAction." The same action is performed if a state machine reaches its top level FinalState.

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