gzz
Interface ObsTrigger

gzz.Cell gzz.Dim gzz.Space gzz.CellTexter gzz.VStreamCellTexter gzz.JavaObjector gzz.Obs gzz.ObsTrigger ../../Gzz_CoreAPIs.gen.html#core core_small gzz.Space gzz.impl.AbstractSpace gzz.CellTexter gzz.VStreamCellTexter gzz.impl.SimpleVStreamTexter gzz.impl.ModularSpace gzz.ObsTrigger gzz.impl.SimpleObsTrigger gzz.IdentityManager gzz.impl.DummyIdentityManager gzz.CellManager gzz.impl.AbstractCellManager gzz.impl.PlainCellManager gzz.DimManager gzz.impl.AbstractDimManager SimpleDim.Manager gzz.diff.DeltaSpace gzz.impl.ModularDeltaSpace gzz.diff.DeltaDimManager gzz.diff.DeltaCellTexter gzz.impl.AbstractDeltaDimManager gzz.impl.SimpleDeltaVStreamTexter ../../Gzz_Backend.gen.html#modularspace modularspace_small
All Known Implementing Classes:
DummyObsTrigger, SimpleObsTrigger

public interface ObsTrigger

An interface for attaching and triggering Obses. Basically, each observer (Obs) may observe several combinations of (Object, Object) pairs. The first one of the objects is expected to have '==' equality, generally they will be Dims or objects inside dims. The second object is used through .equals.

This interface is meant for synchronous use: the Obs.chg() methods are called only from the callQueued method of this class.

This is mostly meant to be used inside space implementations.

See Also:
Obs

Field Summary
static java.lang.String rcsid
           
 
Method Summary
 void addObs(Obs o, java.lang.Object obj, java.lang.Object code)
          Add an observer.
 void callQueued()
          Call the changed observers.
 void chg(java.lang.Object obj, java.lang.Object code)
          Signal that the observers for the given pair should be triggered.
 void rmObs(Obs o)
          Remove all observations that the given observer is making.
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values
Method Detail

addObs

public void addObs(Obs o,
                   java.lang.Object obj,
                   java.lang.Object code)
Add an observer.

Parameters:
o - The observer. If null, nothing is done; no error may be thrown. (Rationale: otherwise, we would have to check for nullity in all places that call addObs, because they can (almost) all be passed null observers.)

rmObs

public void rmObs(Obs o)
Remove all observations that the given observer is making.


chg

public void chg(java.lang.Object obj,
                java.lang.Object code)
Signal that the observers for the given pair should be triggered. All observers that are triggered are then removed from further processing.


callQueued

public void callQueued()
Call the changed observers.