stella.sensor
Class TimerTaskSensor.SensorRead
java.lang.Object
java.util.TimerTask
stella.sensor.TimerTaskSensor.SensorRead
- All Implemented Interfaces:
- Runnable
- Enclosing class:
- TimerTaskSensor
protected class TimerTaskSensor.SensorRead
- extends TimerTask
The timer task helper class to allow this sensor to be scheduled via a
Timer object. If multiple inheritance would be allowed, the timer task
sensor could directly subclass a timer task.
|
Field Summary |
private boolean |
running
Lets a thread check, if another one is currently underway. |
|
Method Summary |
void |
run()
Reads this sensor at a specified frequency. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
running
private boolean running
- Lets a thread check, if another one is currently underway.
TimerTaskSensor.SensorRead
protected TimerTaskSensor.SensorRead()
- Constructs a new sensor read as a timer task.
run
public void run()
- Reads this sensor at a specified frequency.
The thread can be stopped
by calling its cancel() superclass-method.
This method calls the protected abstract method readSensor() of the
embedding class, that
actually converts the signal of the sensor to a double. Note that at
times of high cpu-load of the system, the execution of the reading
process may occur at non-equally spaced time intervalls.
- Specified by:
run in interface Runnable- Specified by:
run in class TimerTask