Mobile Sensor API Version 1.2

javax.microedition.sensor
Interface Condition

All Known Implementing Classes:
LimitCondition, ObjectCondition, RangeCondition

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

OP_EQUALS

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.

See Also:
Constant Field Values

OP_GREATER_THAN

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.

See Also:
Constant Field Values

OP_GREATER_THAN_OR_EQUALS

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.

See Also:
Constant Field Values

OP_LESS_THAN

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.

See Also:
Constant Field Values

OP_LESS_THAN_OR_EQUALS

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.

See Also:
Constant Field Values
Method Detail

isMet

boolean isMet(double doubleValue)

The method tests if the doubleValue given as a parameter meets the Condition.

Parameters:
doubleValue - the measured data value as a double value, which is checked against the Condition
Returns:
true if Condition is met, false otherwise

isMet

boolean isMet(java.lang.Object value)

The method tests if the value given as the parameter meets the Condition.

Parameters:
value - the measured data value to be checked
Returns:
true if Condition is met, false otherwise

Mobile Sensor API Version 1.2

Copyright © 2005-2008 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.