org.placelab.client.tracker
Class FilteredEstimateListener

java.lang.Object
  extended byorg.placelab.client.tracker.FilteredEstimateListener
All Implemented Interfaces:
EstimateListener

public class FilteredEstimateListener
extends java.lang.Object
implements EstimateListener

This filters estimateUpdated measurements by either count or time. So, for instance, you could say that you only want to get estimateUpdated every 3 seconds or you could filter by count and get only every fifth estimateUpdated.

You use this by creating it with your EstimateListener object and then registering this with the Tracker you wish to filter estimateUpdated events from.


Field Summary
static int FILTER_BY_NUMBER
           
static int FILTER_BY_TIME
           
 
Constructor Summary
FilteredEstimateListener(EstimateListener listener, long interval, int intervalType)
          Create a FilteredEstimateListener
 
Method Summary
 void estimateUpdated(Tracker t, Estimate e, Measurement m)
          Implement this method to respond to updates from the Tracker(s) you are registered with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_BY_TIME

public static final int FILTER_BY_TIME
See Also:
Constant Field Values

FILTER_BY_NUMBER

public static final int FILTER_BY_NUMBER
See Also:
Constant Field Values
Constructor Detail

FilteredEstimateListener

public FilteredEstimateListener(EstimateListener listener,
                                long interval,
                                int intervalType)
Create a FilteredEstimateListener

Parameters:
listener - the object to receive the estimateUpdated messages
interval - the minimum time or count between estimateUpdated messages you want to take
intervalType - either FILTER_BY_NUMBER or FILTER_BY_TIME
Method Detail

estimateUpdated

public void estimateUpdated(Tracker t,
                            Estimate e,
                            Measurement m)
Description copied from interface: EstimateListener
Implement this method to respond to updates from the Tracker(s) you are registered with.

Specified by:
estimateUpdated in interface EstimateListener
Parameters:
t - the Tracker producing the Estimate
e - the Estimate produced by the Tracker
m - the latest Measurement used by the Tracker to produce the Estimate