org.primordion.xholon.base
Class ObservableXholonWithPorts

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.base.ObservableXholonWithPorts
All Implemented Interfaces:
IObservable, IXholon
Direct Known Subclasses:
XhStopWatch_Xhym

public class ObservableXholonWithPorts
extends XholonWithPorts
implements IObservable

Observable Xholon with ports.

Since:
0.5 (Created on March 12, 2007)
Author:
Ken Webb
See Also:
on Java.util.Observable class; inspired by Gamma et al. (1995). Design Patterns. (Observer pattern)

Field Summary
 
Fields inherited from class org.primordion.xholon.base.XholonWithPorts
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
ObservableXholonWithPorts()
           
 
Method Summary
 void addObserver(IXholon o)
          Adds an observer to the set of observers for this object.
 int countObservers()
          Returns the number of observers of this Observable object.
 void deleteObserver(IXholon o)
          Deletes an observer from the set of observers of this object.
 void deleteObservers()
          Clears the observer list so that this object no longer has any observers.
 java.lang.Object getChangedData()
          Get changed data.
 boolean hasChanged()
          Tests if this object has changed.
 void notifyObservers()
          If this object has changed, then notify all of its observers.
 void notifyObservers(java.lang.Object arg)
          If this object has changed, then notify all of its observers.
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, initialize, isActiveObject, isBound, isContainer, isPassiveObject, postConfigure, setMaxPorts, setPorts, terminate
 
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
 
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
 

Constructor Detail

ObservableXholonWithPorts

public ObservableXholonWithPorts()
Method Detail

addObserver

public void addObserver(IXholon o)
Description copied from interface: IObservable
Adds an observer to the set of observers for this object.

Specified by:
addObserver in interface IObservable
Parameters:
o - An observer.

countObservers

public int countObservers()
Description copied from interface: IObservable
Returns the number of observers of this Observable object.

Specified by:
countObservers in interface IObservable
Returns:
The current number of observers.

deleteObserver

public void deleteObserver(IXholon o)
Description copied from interface: IObservable
Deletes an observer from the set of observers of this object.

Specified by:
deleteObserver in interface IObservable
Parameters:
o - An observer.

deleteObservers

public void deleteObservers()
Description copied from interface: IObservable
Clears the observer list so that this object no longer has any observers.

Specified by:
deleteObservers in interface IObservable

notifyObservers

public void notifyObservers()
Description copied from interface: IObservable
If this object has changed, then notify all of its observers.

Specified by:
notifyObservers in interface IObservable

notifyObservers

public void notifyObservers(java.lang.Object arg)
Description copied from interface: IObservable
If this object has changed, then notify all of its observers.

Specified by:
notifyObservers in interface IObservable
Parameters:
arg - Some data.

hasChanged

public boolean hasChanged()
Description copied from interface: IObservable
Tests if this object has changed.

Specified by:
hasChanged in interface IObservable
Returns:
true if and only if the setChanged method has been called more recently than the clearChanged method on this object; false otherwise.

getChangedData

public java.lang.Object getChangedData()
Description copied from interface: IObservable
Get changed data.

Specified by:
getChangedData in interface IObservable
Returns:
Some Object, or null.