Mobile Sensor API Version 1.2

javax.microedition.sensor.control
Interface MeasurementRangeControl

All Superinterfaces:
Control

public interface MeasurementRangeControl
extends Control

A MeasurementRangeControl object is an example of a general control used to set the measurement range of the sensor. A controllable sensor that can offer the possibility to set a measurement range may provide a MeasurementRangeControl via its getControl() and getControls() methods. If the measurement range control is provided, it MUST inherit this interface. For this control to be implementable, at least one channel of the sensor must have multiple measurement ranges.

The execute() method is used to set the default measurement range for each channel at once.


Method Summary
 MeasurementRange getMeasurementRange(ChannelInfo channelInfo)
          Returns the current measurement range of the given channel.
 void setMeasurementRange(ChannelInfo channelInfo, MeasurementRange measurementRange)
          Sets the measurement range of the channel.
 
Methods inherited from interface javax.microedition.sensor.control.Control
execute, getName
 

Method Detail

getMeasurementRange

MeasurementRange getMeasurementRange(ChannelInfo channelInfo)

Returns the current measurement range of the given channel. The measurement range MUST be one of the measurement ranges of the channel returned by the method ChannelInfo.getMeasurementRanges().

Parameters:
channelInfo - the channel whose measurement range is queried
Returns:
the current measurement range of the given channel.
Throws:
java.lang.IllegalArgumentException - if the data type of the channel is TYPE_OBJECT
java.lang.NullPointerException - if the given channel is null

setMeasurementRange

void setMeasurementRange(ChannelInfo channelInfo,
                         MeasurementRange measurementRange)

Sets the measurement range of the channel.

Parameters:
channelInfo - the channel whose measurement range is to be set.
measurementRange - the measurement range to be set.
Throws:
java.lang.IllegalArgumentException - if the given range is none of the ranges returned by the method ChannelInfo.getMeasurementRanges(), or if the data type of the channel is TYPE_OBJECT.
java.lang.IllegalStateException - if the measurement range cannot be set
java.lang.NullPointerException - if the given channel or measurement range is null

Mobile Sensor API Version 1.2

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