Mobile Sensor API Version 1.2

javax.microedition.sensor
Class ObjectCondition

java.lang.Object
  extended by javax.microedition.sensor.ObjectCondition
All Implemented Interfaces:
Condition

public final class ObjectCondition
extends java.lang.Object
implements Condition

The ObjectCondition checks the equality of the set limit to the measured data value. This Condition is intended for a channel, the data type of which is ChannelInfo.TYPE_OBJECT. The equality is checked by using the equals() method of the set limit. The ObjectCondition MUST be immutable.


Field Summary
 
Fields inherited from interface javax.microedition.sensor.Condition
OP_EQUALS, OP_GREATER_THAN, OP_GREATER_THAN_OR_EQUALS, OP_LESS_THAN, OP_LESS_THAN_OR_EQUALS
 
Constructor Summary
ObjectCondition(java.lang.Object limit)
          Constructs an ObjectCondition.
 
Method Summary
 java.lang.Object getLimit()
          Returns the limit that was set.
 boolean isMet(double value)
          The method tests if the doubleValue given as a parameter meets the condition
 boolean isMet(java.lang.Object value)
          Method tests if the given value meets the ObjectCondition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectCondition

public ObjectCondition(java.lang.Object limit)

Constructs an ObjectCondition. The parameter defines the limit that will be used to check the measured values for equality.

Parameters:
limit - the limit value to be set
Throws:
java.lang.NullPointerException - if limit is null
Method Detail

getLimit

public final java.lang.Object getLimit()

Returns the limit that was set. The limit Object could be, for example, a String or a byte array.

Returns:
the limit, the equality of which is checked against the measured value

isMet

public boolean isMet(double value)

The method tests if the doubleValue given as a parameter meets the condition

Specified by:
isMet in interface Condition
Parameters:
value - the measured data value, the equality of which to the set limit is checked
Returns:
always false, because the ObjectCondition is used for testing Object values only

isMet

public boolean isMet(java.lang.Object value)

Method tests if the given value meets the ObjectCondition. Equality is tested with the equals method of the defined limit.

Specified by:
isMet in interface Condition
Parameters:
value - the measured data value, the equality of which to the set limit is checked
Returns:
true if ObjectCondition 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.