org.placelab.client.tracker
Class CompoundTracker

java.lang.Object
  extended byorg.placelab.client.tracker.Tracker
      extended byorg.placelab.client.tracker.CompoundTracker
All Implemented Interfaces:
SpotterListener
Direct Known Subclasses:
BestGuessCompoundTracker

public class CompoundTracker
extends Tracker

A CompoundTracker encapsulates multiple Tracker objects in a single Tracker. This is useful primarily for comparing multiple Trackers against one another. For instance, using a CompoundTracker with a TrackedMapView will produce multiple position reticles on the map, one for each Tracker in the CompoundTracker.


Constructor Summary
CompoundTracker()
           
 
Method Summary
 boolean acceptableMeasurement(Measurement m)
          Returns true if the tracker can make use of this reading to meaningfully update the estimate.
 void addTracker(Tracker t)
          Adds a Tracker to the CompoundTracker All trackers added will be forwarded all requests to update, either with or without Measurement.
 void clearTrackers()
          Removes all the Trackers from the CompoundTracker.
 Estimate getEstimate()
           
 java.util.Vector getTrackers()
          Gets a Vector of all Trackers in this CompoundTracker
 void resetImpl()
          Subclasses should implement this to reset themselves to their initial state.
 void updateEstimateImpl(Measurement m)
          Subclasses should implement this to do the actual work of updating their Estimate with the given Measurement.
 void updateWithoutMeasurement(long durationMillis)
          This method notifies a tracker that time has elapsed without a new mesurement.
 
Methods inherited from class org.placelab.client.tracker.Tracker
addEstimateListener, fireEstimateUpdate, getLastUpdatedTime, gotMeasurement, numberOfMeasurements, removeEstimateListener, reset, spotterExceptionThrown, updateEstimate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompoundTracker

public CompoundTracker()
Method Detail

addTracker

public void addTracker(Tracker t)
Adds a Tracker to the CompoundTracker All trackers added will be forwarded all requests to update, either with or without Measurement.

Parameters:
t - the Tracker to add

getTrackers

public java.util.Vector getTrackers()
Gets a Vector of all Trackers in this CompoundTracker


clearTrackers

public void clearTrackers()
Removes all the Trackers from the CompoundTracker. The Trackers will not be reset and may continue to be used elsewhere, but they will no longer be updated with by the CompoundTracker and their estimates will no longer be included in the CompoundTracker's CompoundEstimate results.


updateEstimateImpl

public void updateEstimateImpl(Measurement m)
Description copied from class: Tracker
Subclasses should implement this to do the actual work of updating their Estimate with the given Measurement.

Specified by:
updateEstimateImpl in class Tracker
Parameters:
m - use this to update your Estimate

getEstimate

public Estimate getEstimate()
Specified by:
getEstimate in class Tracker
Returns:
The Tracker's latest Estimate

acceptableMeasurement

public boolean acceptableMeasurement(Measurement m)
Description copied from class: Tracker
Returns true if the tracker can make use of this reading to meaningfully update the estimate.

Specified by:
acceptableMeasurement in class Tracker

updateWithoutMeasurement

public void updateWithoutMeasurement(long durationMillis)
Description copied from class: Tracker
This method notifies a tracker that time has elapsed without a new mesurement. This gives the tracker a chance to update its estimate to account for predicted motion.

Specified by:
updateWithoutMeasurement in class Tracker

resetImpl

public void resetImpl()
Description copied from class: Tracker
Subclasses should implement this to reset themselves to their initial state.

Specified by:
resetImpl in class Tracker