JanosVM v1.0 API

kaffe.sensors
Class Sensor

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

public class Sensor
extends java.lang.Object

A Sensor corresponds to a chip that contains several features that can be read from or written to. This class is relatively primitive and should probably be extended by more capable classes.


Field Summary
private  java.util.Hashtable features
          The set of sensor features.
private  kaffe.util.Ptr internal
          Link to any internal data structures used by the native library.
private  java.lang.String name
          The name of the sensor.
private  Sensor next
          Link to next node in the list.
private static java.lang.Class SENSOR_FEATURE_CLASS
          Cached reference to the feature class.
private static java.lang.Class THIS_CLASS
          Cached reference to this class.
 
Constructor Summary
protected Sensor()
          Construct an empty Sensor object.
 
Method Summary
(package private) static void ()
           
static java.util.Hashtable detect()
          Detect and return a table of sensors.
static java.util.Hashtable detect(java.lang.Class sensorClass, java.lang.Class featureClass)
          Detect and return a table of sensors.
private  SensorFeature detectFeatures(java.lang.Class featureClass)
          Detect the set of sensor features.
 boolean equals(java.lang.Object obj)
           
 SensorFeature getFeature(java.lang.String name)
           
 java.util.Enumeration getFeatures()
           
 java.lang.String getName()
           
 int hashCode()
           
private static Sensor nativeDetect(java.lang.Class cls)
          Detect and return a list sensors in the computer.
private static void nativeInit()
          Initialize any native data.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

THIS_CLASS

private static final java.lang.Class THIS_CLASS
Cached reference to this class.

SENSOR_FEATURE_CLASS

private static final java.lang.Class SENSOR_FEATURE_CLASS
Cached reference to the feature class.

next

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

internal

private kaffe.util.Ptr internal
Link to any internal data structures used by the native library.

name

private java.lang.String name
The name of the sensor.

features

private final java.util.Hashtable features
The set of sensor features.
Constructor Detail

Sensor

protected Sensor()
Construct an empty Sensor object.
Method Detail

nativeInit

private static void nativeInit()
                        throws java.lang.Exception
Initialize any native data.

nativeDetect

private static Sensor nativeDetect(java.lang.Class cls)
Detect and return a list sensors in the computer.
Parameters:
cls - The Sensor subclass that should be used when creating new objects.
Returns:
A linked list of Sensors that were detected.

static void ()

detect

public static java.util.Hashtable detect(java.lang.Class sensorClass,
                                         java.lang.Class featureClass)
Detect and return a table of sensors.
Parameters:
sensorClass - The class to use when creating Sensor objects.
featureClass - The class to use when creating SensorFeature objects.
Returns:
A Hashtable that maps sensor chip names to Sensor objects.

detect

public static java.util.Hashtable detect()
Detect and return a table of sensors.
Returns:
A Hashtable that maps sensor chip names to Sensor objects.

detectFeatures

private SensorFeature detectFeatures(java.lang.Class featureClass)
Detect the set of sensor features.
Parameters:
featureClass - The class to use when creating SensorFeature objects.
Returns:
A list of SensorFeatures that are supported by this Sensor.

getName

public java.lang.String getName()
Returns:
The name of the sensor.

getFeatures

public java.util.Enumeration getFeatures()
Returns:
An Enumeration of all the sensor's features.

getFeature

public SensorFeature getFeature(java.lang.String name)
Parameters:
name - The specific name of a sensor feature.
Returns:
The SensorFeature corresponding to the given name or null if it couldn't be found.

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