JanosVM v1.0 API

kaffe.sensors
Class SensorFeature

java.lang.Object
  |
  +--kaffe.sensors.SensorFeature

public class SensorFeature
extends java.lang.Object

A SensorFeature corresponds to a specific feature of a sensor chip and is used to read and write data.


Field Summary
private  kaffe.util.Ptr internal
          The internal data for this feature.
private  int mode
          The access modes for this feature.
static int MODE_NO_RW
          SensorFeature mode indicating that no reading or writing is allowed.
static int MODE_R
          SensorFeature mode indicating that only reading is allowed.
static int MODE_RW
          SensorFeature mode indicating that reading and writing is allowed.
static int MODE_W
          SensorFeature mode indicating that only writing is allowed.
private  java.lang.String name
          The name of this feature.
(package private)  SensorFeature next
          Link to next node in the list.
private  Sensor sensor
          The sensor that this feature is a part of.
 
Constructor Summary
protected SensorFeature()
          Construct an empty SensorFeature.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getMode()
           
 java.lang.String getName()
           
 Sensor getSensor()
           
 int hashCode()
           
 double read()
           
protected  void setMode(int mode)
           
 java.lang.String toString()
           
 void write(double value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

MODE_NO_RW

public static final int MODE_NO_RW
SensorFeature mode indicating that no reading or writing is allowed.

MODE_R

public static final int MODE_R
SensorFeature mode indicating that only reading is allowed.

MODE_W

public static final int MODE_W
SensorFeature mode indicating that only writing is allowed.

MODE_RW

public static final int MODE_RW
SensorFeature mode indicating that reading and writing is allowed.

next

SensorFeature next
Link to next node in the list. XXX This is only used during creation.

sensor

private Sensor sensor
The sensor that this feature is a part of.

name

private java.lang.String name
The name of this feature.

mode

private int mode
The access modes for this feature.

internal

private kaffe.util.Ptr internal
The internal data for this feature.
Constructor Detail

SensorFeature

protected SensorFeature()
Construct an empty SensorFeature.
Method Detail

getSensor

public Sensor getSensor()
Returns:
The sensor that this feature is a part of.

getName

public java.lang.String getName()
Returns:
The name of this feature.

setMode

protected void setMode(int mode)
Parameters:
mode - The access modes for this feature.

getMode

public int getMode()
Returns:
The access modes for this feature.

read

public double read()
            throws java.io.IOException
Returns:
The current value from this sensor feature.
Throws:
java.io.IOException - if there was a problem reading the sensor.

write

public void write(double value)
           throws java.io.IOException
Parameters:
value - The value to write to this sensor feature.
Throws:
java.io.IOException - if there was a problem writing to the sensor.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003