com.sensorcon.sensordrone.android.tools
Class DroneStreamer

java.lang.Object
  extended by com.sensorcon.sensordrone.android.tools.DroneStreamer
All Implemented Interfaces:
java.lang.Runnable

public abstract class DroneStreamer
extends java.lang.Object
implements java.lang.Runnable

This is an interface that can perform a repeatable task at a designated interval, whose start/stop can be controlled. (Basically an on/off repeating runnable)


Field Summary
 boolean isRunning
           
 
Constructor Summary
DroneStreamer(CoreDrone aDrone, int streamRate)
          Our default Constructor
 
Method Summary
abstract  void repeatableTask()
          The code you want to repeatably run at the designated streamRate
 void run()
           
 void setRate(int streamRate)
          A method to set the frequency that the repeatableTask is performed at.
 void start()
          Start the repeatableTask at the designated streamRate
 void stop()
          Stop the repeatableTask from repeating
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isRunning

public boolean isRunning
Constructor Detail

DroneStreamer

public DroneStreamer(CoreDrone aDrone,
                     int streamRate)
Our default Constructor

Parameters:
aDrone -
streamRate -
Method Detail

setRate

public void setRate(int streamRate)
A method to set the frequency that the repeatableTask is performed at.

Parameters:
streamRate - Rate in milliseconds

start

public void start()
Start the repeatableTask at the designated streamRate


stop

public void stop()
Stop the repeatableTask from repeating


run

public void run()
Specified by:
run in interface java.lang.Runnable

repeatableTask

public abstract void repeatableTask()
The code you want to repeatably run at the designated streamRate