Mobile Sensor API Version 1.2

javax.microedition.sensor
Class MeasurementRange

java.lang.Object
  extended by javax.microedition.sensor.MeasurementRange

public class MeasurementRange
extends java.lang.Object

This class represents the measurement range of one channel of the sensor. The channel may have several measurement ranges. Retrieved data values MUST reside within one of the measurement ranges of the channel. MeasurementRange objects can be asked with the query ChannelInfo.getMeasurementRanges(). In addition to the smallest and largest value, the class also contains the resolution.

The range may be switched to another during the measurement. The range and the resolution are related values. The resolution varies according to the measurement range in use.

Range limits and resolution MUST be presented in the same scale and have the same unit as measured data values. The MeasurementRange MUST be immutable.


Constructor Summary
MeasurementRange(double smallest, double largest, double resolution)
          Creates the MeasurementRange object, with given limits and resolution
 
Method Summary
 double getLargestValue()
          Returns the largest value of the measurement range.
 double getResolution()
          Returns the resolution of the range.
 double getSmallestValue()
          Returns the smallest value of the range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementRange

public MeasurementRange(double smallest,
                        double largest,
                        double resolution)

Creates the MeasurementRange object, with given limits and resolution

Parameters:
smallest - the smallest value of the measurement range
largest - the largest value of the measurement range
resolution - the resolution of the measurement range
Throws:
java.lang.IllegalArgumentException - if smallest > largest, or resolution < 0
Method Detail

getLargestValue

public double getLargestValue()

Returns the largest value of the measurement range. The value is the same as that given as the constructor parameter for the largest value.

Returns:
the largest value of this measurement range

getResolution

public double getResolution()

Returns the resolution of the range. The resolution is the smallest amount of change in the input of a sensor that can be detected as a change in the output. Resolution is a property of the transducer of a sensor but the input and output ranges and word length of the A/D converter usually set the limitations for the resolution of a digital sensor.

Returns:
resolution of the channel, the value is the same as that given as the constructor parameter for the resolution

getSmallestValue

public double getSmallestValue()

Returns the smallest value of the range. The value is the same as that given as the constructor parameter for the smallest value.

Returns:
the smallest value of this measurement range

Mobile Sensor API Version 1.2

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