com.speckled.specksim.state
Class StateProcessor

java.lang.Object
  extended by com.speckled.specksim.state.StateProcessor
Direct Known Subclasses:
NeighbourhoodProcessor

public abstract class StateProcessor
extends java.lang.Object

StateProcessors are useful when you want to do some processing on the state, and then use the results both in visualisation and in statistic gathering without duplicating the work. Note that you can make StateProcessors Configurable if you wish.

Author:
ryanm

Constructor Summary
StateProcessor()
           
 
Method Summary
protected abstract  void doProcessing(StateSink statesink)
          Override this method to do the actual work of the processor.
abstract  java.lang.String getName()
          Gets the name of this StateProcessor
protected  void processState()
          This should be called by subclasses every time that the output of the processor is requested.
protected  void refreshStateListeners()
          Sub classes can call this method whenever they are changed in order for other state consumers to take note of the change
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateProcessor

public StateProcessor()
Method Detail

getName

public abstract java.lang.String getName()
Gets the name of this StateProcessor

Returns:
A String name

processState

protected final void processState()
This should be called by subclasses every time that the output of the processor is requested. Dirty flags are used to ensure that the processing is performed only as strictly necessary.


doProcessing

protected abstract void doProcessing(StateSink statesink)
Override this method to do the actual work of the processor. This will only be called if the state has been updated since the last time this processor was used

Parameters:
statesink - The state to process

refreshStateListeners

protected final void refreshStateListeners()
Sub classes can call this method whenever they are changed in order for other state consumers to take note of the change