org.primordion.xholon.base
Class PortXhym

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.PortXhym
All Implemented Interfaces:
IXholon

public class PortXhym
extends Xholon

A Port Xhym interacts with an individual port, and with its XhymAgent.

Since:
0.5 (Created on March 12, 2007)
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
PortXhym()
           
 
Method Summary
 void act()
          Do some action during this time step.
 IXholon getPort(int portNum)
          Get the port that corresponds to this index (0 indexed).
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
 void sendMessage(int signal, java.lang.Object data, IXholon sender)
          This is the Xholon equivalent of update(Observable o, Object arg) in Java.util.Observer, where: signal is ISignal.SIGNAL_UPDATE, and represents the update() function itself.
 java.lang.String toString()
           
 
Methods inherited from class org.primordion.xholon.base.Xholon
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, 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, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, resetNextId, 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
 

Field Detail

port

public IXholon[] port
Constructor Detail

PortXhym

public PortXhym()
Method Detail

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

act

public void act()
Description copied from interface: IXholon
Do some action during this time step. Typically all nodes in the tree will do their pre-actions (optional), then all will do their actions, and then all will do their post-actions (optional).

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

sendMessage

public void sendMessage(int signal,
                        java.lang.Object data,
                        IXholon sender)
This is the Xholon equivalent of update(Observable o, Object arg) in Java.util.Observer, where: signal is ISignal.SIGNAL_UPDATE, and represents the update() function itself. data is optional, and represents the optional Object arg. sender represents Observable o. Create an instance of Message, fill in the data portion of the Message with what has changed in the sender, and forward the Message to a XhymAgent.

Specified by:
sendMessage in interface IXholon
Overrides:
sendMessage in class Xholon
See Also:
Xholon.sendMessage(int, java.lang.Object, org.primordion.xholon.base.IXholon)

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

toString

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