com.sentilla.system
Interface Sensor<Q extends Quantity>

All Superinterfaces:
Action

public interface Sensor<Q extends Quantity>
extends Action

Reads a single value from a sensor. Sensor returns a Measureable instance that contains the measureable quantity read from the sensor.

The action verb for Sensor is read.

After reading a sensor, be sure to compare its value using Measureable.doubleValue(unit), where unit defines the resulting unit for the reading (such as SI.Celsius for a Temperature reading).

See Also:
Quantity, Measurable, SI, SensorDriver

Field Summary
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Method Summary
 Measurable<Q> getResult()
          Asynchronous interface to get the result of the last sensor read operation.
 Measurable<Q> read()
          Read a new measurement and return the result.
 Sensor<Q> setRead()
          Asynchronous interface to set up a read operation on a sensor.
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, isDone, submit
 

Method Detail

read

Measurable<Q> read()
Read a new measurement and return the result.

After reading a sensor, be sure to read its value using Measureable.doubleValue(unit), where unit defines the resulting unit for the reading (such as SI.Celsius for a temperature reading).

Returns:
Sensor measurement of type Q.

setRead

Sensor<Q> setRead()
Asynchronous interface to set up a read operation on a sensor. Use the submit() function to initiating the sensor reading.

Returns:
The instance of Sensor that is set to read its sensor

getResult

Measurable<Q> getResult()
Asynchronous interface to get the result of the last sensor read operation.

Returns:
Sensor measurement of type Q.


Copyright © 2007 Sentilla Corporation. All Rights Reserved.