SketchAggSensor
Class Clock

public class Clock
Constructor Detail

Clock

public Clock()
Constructor

Method Detail

addListener

public void addListener(ClockListener l)
Register the specified listener with the clock

setFinalListener

public void setFinalListener(ClockListener l)
Allow a specific listener to be guaranteed that it is the last to be updated

nextTime

public void nextTime()
Advance the clock, notifying all of the listeners (in unspecified order), with the finalListener notified last.

getTime

public int getTime()
Return the current time on the clock

getEpoch

public static int getEpoch(int time)
Return the number of epochs represented by the current time. Currently, epochs are two time intervals...

Why do this?

So that sensors can all be notified of a new epoch, send out and process messages before any other sensors have moved on to the next epoch.