agg.attribute.impl
Class ChainedObserver

java.lang.Object
  extended by agg.attribute.impl.AttrObject
      extended by agg.attribute.impl.ManagedObject
          extended by agg.attribute.impl.ChainedObserver
All Implemented Interfaces:
AttrObserver, AttrTuple, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
TupleObject

public abstract class ChainedObserver
extends ManagedObject
implements AttrObserver, AttrTuple

Handling of attribute observers.

See Also:
AttrObserver, Serialized Form

Field Summary
protected static int MAX_SIZE_OF_EVENT_STACK
           
protected static int sizeOfEventStack
           
 
Fields inherited from class agg.attribute.impl.ManagedObject
manager
 
Fields inherited from class agg.attribute.impl.AttrObject
classHandlerExpr, classObject, classString, initialized
 
Fields inherited from interface agg.attribute.AttrObserver
serialVersionUID
 
Constructor Summary
ChainedObserver(AttrTupleManager m)
           
 
Method Summary
 void addObserver(AttrObserver attrObs)
          Adding a new attribute observer.
 void addObserverAtPos(AttrObserver attrObs, int pos)
           
 void attributeChanged(AttrEvent evt)
          Checks if an endless event recursion took place.
 boolean contains(AttrObserver attrObs)
           
protected  TupleEvent filterEvent(AttrObserver obs, TupleEvent e)
          This method should be overridden by classes that wish to customize or filter the actual event depending on the respective observer and/or its own framework (index transformation, id change).
protected  int findObserver(AttrObserver obj)
           
protected  void fireAttrChanged(int id, int index)
           
protected  void fireAttrChanged(int id, int index0, int index1)
           
protected  void fireAttrChanged(TupleEvent evt)
           
 java.util.Enumeration<AttrObserver> getObservers()
           
 boolean isPersistentFor(AttrTuple at)
          Per default, always save observer dependencies within the attribute component.
protected abstract  void propagateEvent(TupleEvent e)
          Propagates the event to the observers, pretending to be the source.
 void removeObserver(AttrObserver attrObs)
          Removing an attribute observer from the list of observers.
protected  void updateGeneralChange(TupleEvent event)
          Fires the same event.
protected  void updateMemberAdded(TupleEvent event)
          Fires the same event.
protected  void updateMemberDeleted(TupleEvent event)
          Fires the same event.
protected  void updateMemberModified(TupleEvent event)
          Fires the same event.
protected  void updateMemberRenamed(TupleEvent event)
          Fires the same event.
protected  void updateMemberRetyped(TupleEvent event)
          Fires the same event.
protected  void updateUnknownChange(TupleEvent event)
          Fires the same event.
protected  void updateValueCorrectness(TupleEvent event)
          Fires the same event.
protected  void updateValueModified(TupleEvent event)
          Fires the same event.
 
Methods inherited from class agg.attribute.impl.ManagedObject
getAttrManager, getManager
 
Methods inherited from class agg.attribute.impl.AttrObject
defaultToString, err, err, getInstRepr, log, log, log, logEnteredMethod, logPrintln, logPrintln, stdoutPrintOnEnter, stdoutPrintOnExit, toString, update, warn, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agg.attribute.AttrTuple
getAttrManager, getIndexForMember, getMemberAt, getMemberAt, getMemberAt, getNameAsString, getNameAsString, getNumberOfEntries, getNumberOfEntries, getTupleType, getTypeAsString, getTypeAsString, getValueAsString, getValueAsString, isValid
 

Field Detail

MAX_SIZE_OF_EVENT_STACK

protected static final int MAX_SIZE_OF_EVENT_STACK
See Also:
Constant Field Values

sizeOfEventStack

protected static int sizeOfEventStack
Constructor Detail

ChainedObserver

public ChainedObserver(AttrTupleManager m)
Method Detail

getObservers

public java.util.Enumeration<AttrObserver> getObservers()

addObserver

public void addObserver(AttrObserver attrObs)
Description copied from interface: AttrTuple
Adding a new attribute observer.

Specified by:
addObserver in interface AttrTuple
Parameters:
attrObs - The attribute observer to be registered.

contains

public boolean contains(AttrObserver attrObs)

addObserverAtPos

public void addObserverAtPos(AttrObserver attrObs,
                             int pos)

findObserver

protected int findObserver(AttrObserver obj)

removeObserver

public void removeObserver(AttrObserver attrObs)
Description copied from interface: AttrTuple
Removing an attribute observer from the list of observers.

Specified by:
removeObserver in interface AttrTuple
Parameters:
attrObs - The attribute observer to be registered.

fireAttrChanged

protected void fireAttrChanged(int id,
                               int index)

fireAttrChanged

protected void fireAttrChanged(int id,
                               int index0,
                               int index1)

fireAttrChanged

protected void fireAttrChanged(TupleEvent evt)

propagateEvent

protected abstract void propagateEvent(TupleEvent e)
Propagates the event to the observers, pretending to be the source.


filterEvent

protected TupleEvent filterEvent(AttrObserver obs,
                                 TupleEvent e)
This method should be overridden by classes that wish to customize or filter the actual event depending on the respective observer and/or its own framework (index transformation, id change). If [null] is returned, the specified observer will not get any notification this time.


isPersistentFor

public boolean isPersistentFor(AttrTuple at)
Per default, always save observer dependencies within the attribute component.

Specified by:
isPersistentFor in interface AttrObserver

attributeChanged

public void attributeChanged(AttrEvent evt)
Checks if an endless event recursion took place. If so, a runtime exception with a warning text is thrown, as this indicates an error in the implementation. Otherwise, it calls the one of the respective updating methods which can be overridden by subclasses .

Specified by:
attributeChanged in interface AttrObserver

updateGeneralChange

protected void updateGeneralChange(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateMemberAdded

protected void updateMemberAdded(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateMemberDeleted

protected void updateMemberDeleted(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateMemberModified

protected void updateMemberModified(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateMemberRenamed

protected void updateMemberRenamed(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateMemberRetyped

protected void updateMemberRetyped(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateValueModified

protected void updateValueModified(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateValueCorrectness

protected void updateValueCorrectness(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.


updateUnknownChange

protected void updateUnknownChange(TupleEvent event)
Fires the same event. Subclasses should override this method for customized behaviour.