org.primordion.xholon.base
Interface IObservable

All Superinterfaces:
IXholon
All Known Implementing Classes:
ObservableStateMachineEntity, ObservableXholonWithPorts

public interface IObservable
extends IXholon

An Observable is a Xholon that is observed by another Xholon.

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 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
 
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 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
 

Method Detail

addObserver

public void addObserver(IXholon o)
Adds an observer to the set of observers for this object.

Parameters:
o - An observer.

countObservers

public int countObservers()
Returns the number of observers of this Observable object.

Returns:
The current number of observers.

deleteObserver

public void deleteObserver(IXholon o)
Deletes an observer from the set of observers of this object.

Parameters:
o - An observer.

deleteObservers

public void deleteObservers()
Clears the observer list so that this object no longer has any observers.


notifyObservers

public void notifyObservers()
If this object has changed, then notify all of its observers.


notifyObservers

public void notifyObservers(java.lang.Object arg)
If this object has changed, then notify all of its observers.

Parameters:
arg - Some data.

hasChanged

public boolean hasChanged()
Tests if this object has changed.

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()
Get changed data.

Returns:
Some Object, or null.