|
Mobile Sensor API Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Condition
An application can set conditions to have the data monitored
and receive a notification when the data meets the defined condition.
The Condition
objects define the conditions for
monitoring. There are three types of concrete Condition
classes
provided by this API:
The application developer or the implementer of the API may introduce also new
Condition
objects by implementing this interface.
The Condition
interface offers the common functionality to
check if the condition was met.
Each concrete class implementing Condition
defines
specific methods to query the limits and parameters of the condition,
as the limits and parameters differ depending on the specific type of condition.
Set limits can be asked separately from each
Condition
implementation with special methods, because
limits differ in type and number.
This interface defines constants for comparison operators,
because they are often used in defining the conditions.
The same operator strings are used in the sensor URL for
PushRegistry
for specifying conditions for
push initiated wake-up of the application. The format of the
URL is defined in SensorConnection
.
Field Summary | |
---|---|
static java.lang.String |
OP_EQUALS
The comparison operator that checks if the value got from the sensor is equal to the set limit. |
static java.lang.String |
OP_GREATER_THAN
The comparison operator that checks if the value got from the sensor is greater than the set limit. |
static java.lang.String |
OP_GREATER_THAN_OR_EQUALS
The comparison operator that checks if the value got from the sensor is greater than or equal to the set limit. |
static java.lang.String |
OP_LESS_THAN
The comparison operator that checks if the value got from the sensor is less than the set limi. |
static java.lang.String |
OP_LESS_THAN_OR_EQUALS
The comparison operator that checks if the value got from the sensor is less than or equal to the set limit. |
Method Summary | |
---|---|
boolean |
isMet(double doubleValue)
The method tests if the doubleValue given as a parameter meets the Condition . |
boolean |
isMet(java.lang.Object value)
The method tests if the value given as the parameter meets the Condition . |
Field Detail |
---|
static final java.lang.String OP_EQUALS
The comparison operator that checks if the value got from the sensor is equal to the set limit.
static final java.lang.String OP_GREATER_THAN
The comparison operator that checks if the value got from the sensor is greater than the set limit.
static final java.lang.String OP_GREATER_THAN_OR_EQUALS
The comparison operator that checks if the value got from the sensor is greater than or equal to the set limit.
static final java.lang.String OP_LESS_THAN
The comparison operator that checks if the value got from the sensor is less than the set limi.
static final java.lang.String OP_LESS_THAN_OR_EQUALS
The comparison operator that checks if the value got from the sensor is less than or equal to the set limit.
Method Detail |
---|
boolean isMet(double doubleValue)
The method tests if the doubleValue given as a parameter
meets the Condition
.
doubleValue
- the measured data value as a double value, which is checked against
the Condition
true
if Condition
is met,
false
otherwiseboolean isMet(java.lang.Object value)
The method tests if the value given as the parameter
meets the Condition
.
value
- the measured data value to be checked
true
if Condition
is met,
false
otherwise
|
Mobile Sensor API Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |