SunSPOT API V6.0


com.sun.spot.resources.transducers
Interface IMeasurementRange

All Superinterfaces:
IMeasurementInfo
All Known Implementing Classes:
LIS3L02AQAccelerometer, MMA7455LAccelerometer

public interface IMeasurementRange
extends IMeasurementInfo

Used to get/set the measurement range of a sensor. Similar to the IMeasurementRangeControl() in JSR 256. The min, max, resolution and accuracy of the sensor varies according to the measurement range in use.


Method Summary
 void addIMeasurementRangeListener(IMeasurementRangeListener who)
          Add an IMeasurementRangeListener to be called back when the range is changed.
 double getAccuracy(int index)
          Returns the Nth accuracy of the specified measurement range.
 int getCurrentRange()
          Returns the index of the current measurement range of the given sensor.
 IMeasurementRangeListener[] getIMeasurementRangeListeners()
          Return all of the IMeasurementRangeListener callbacks.
 double getMaxValue(int index)
          Returns the Nth max value of the specified measurement range.
 double getMinValue(int index)
          Returns the Nth min value of the specified measurement range.
 int getNumberRanges()
          Returns the number of possible measurement ranges for this given sensor.
 double getResolution(int index)
          Returns the Nth resolution of the specified measurement range.
 void removeIMeasurementRangeListener(IMeasurementRangeListener who)
          Remove an IMeasurementRangeListener from the list of callbacks.
 void setCurrentRange(int range)
          Sets the measurement range of the sensor.
 
Methods inherited from interface com.sun.spot.resources.transducers.IMeasurementInfo
getAccuracy, getMaxValue, getMinValue, getResolution
 

Method Detail

getNumberRanges

int getNumberRanges()
Returns the number of possible measurement ranges for this given sensor.

Returns:
the number of possible measurement ranges for this given sensor.

getCurrentRange

int getCurrentRange()
Returns the index of the current measurement range of the given sensor.

Returns:
the current measurement range of the given sensor.

setCurrentRange

void setCurrentRange(int range)
Sets the measurement range of the sensor.

Parameters:
range - the index of the measurement range to be set.
Throws:
IllegalArgumentException - - if the given range is not a valid range for the sensor.

getMinValue

double getMinValue(int index)
Returns the Nth min value of the specified measurement range.

Parameters:
index -
Returns:
the Nth min value of the specified measurement range
Throws:
IllegalArgumentException - - if index >= size or index < 0

getMaxValue

double getMaxValue(int index)
Returns the Nth max value of the specified measurement range.

Parameters:
index -
Returns:
the Nth max value of the specified measurement range
Throws:
IllegalArgumentException - - if index >= size or index < 0

getResolution

double getResolution(int index)
Returns the Nth resolution of the specified measurement range.

Parameters:
index -
Returns:
the Nth resolution of the specified measurement range
Throws:
IllegalArgumentException - - if index >= size or index < 0

getAccuracy

double getAccuracy(int index)
Returns the Nth accuracy of the specified measurement range.

Parameters:
index -
Returns:
the Nth accuracy of the specified measurement range
Throws:
IllegalArgumentException - - if index >= size or index < 0

addIMeasurementRangeListener

void addIMeasurementRangeListener(IMeasurementRangeListener who)
Add an IMeasurementRangeListener to be called back when the range is changed.

Parameters:
who - the IMeasurementRangeListener to add

removeIMeasurementRangeListener

void removeIMeasurementRangeListener(IMeasurementRangeListener who)
Remove an IMeasurementRangeListener from the list of callbacks.

Parameters:
who - the IMeasurementRangeListener to remove

getIMeasurementRangeListeners

IMeasurementRangeListener[] getIMeasurementRangeListeners()
Return all of the IMeasurementRangeListener callbacks.

Returns:
an array of the IMeasurementRangeListener callbacks

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.