org.omegahat.Simulation.MCMC.Listeners
Class ThinningProxyListener

java.lang.Object
  |
  +--org.omegahat.Simulation.MCMC.Listeners.ThinningProxyListener
All Implemented Interfaces:
MCMCListener, NotifyingObject

public class ThinningProxyListener
extends java.lang.Object
implements NotifyingObject, MCMCListener

This object serves as a proxy MCMCListener that only forwards 1 out of every thinningFactor events to its subscribers


Inner Class Summary
 class ThinningProxyListener.MyHandle
           
 
Field Summary
protected  java.util.Hashtable listeners
           
protected  int thinningFactor
           
protected  int totalEvents
           
 
Constructor Summary
ThinningProxyListener()
           
ThinningProxyListener(int factor)
           
 
Method Summary
 int getThinningFactor()
           
 int getTotalEvents()
           
 void notify(MCMCEvent event)
          Function to be called for notification
protected  void notifyAll(MCMCEvent e)
           
 MCMCListenerHandle registerListener(MCMCListener listener)
          Register a listener to be notified of events.
 void resetTotalEvents()
           
 int setThinningFactor(int factor)
           
 void unregisterListener(MCMCListenerHandle handle)
          Unregister a listener to be notified of events.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.Hashtable listeners

thinningFactor

protected int thinningFactor

totalEvents

protected int totalEvents
Constructor Detail

ThinningProxyListener

public ThinningProxyListener()

ThinningProxyListener

public ThinningProxyListener(int factor)
Method Detail

getTotalEvents

public int getTotalEvents()

resetTotalEvents

public void resetTotalEvents()

getThinningFactor

public int getThinningFactor()

setThinningFactor

public int setThinningFactor(int factor)

registerListener

public MCMCListenerHandle registerListener(MCMCListener listener)
Description copied from interface: NotifyingObject
Register a listener to be notified of events.
Specified by:
registerListener in interface NotifyingObject

unregisterListener

public void unregisterListener(MCMCListenerHandle handle)
Description copied from interface: NotifyingObject
Unregister a listener to be notified of events.
Specified by:
unregisterListener in interface NotifyingObject

notifyAll

protected void notifyAll(MCMCEvent e)

notify

public void notify(MCMCEvent event)
Function to be called for notification
Specified by:
notify in interface MCMCListener