|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ukcrobots.core.Sensor
A delegating wrapper around the InputDevice class. All methods delegate to the associated device. Multiple sensors may be connected to the same device, if required. However, there are drawbacks to this approach and the most sensible configuration would involve sensors of the same type. This class is based on josx.platform.rcx.Sensor.
Constructor Summary | |
Sensor(int id,
int type,
int mode)
Sets the sensor's mode and type. |
Method Summary | |
void |
activate()
Activates the sensor. |
void |
addSensorListener(SensorListener listener)
Adds a sensor listener. |
protected ukcrobots.core.InputDevice |
getDevice()
Obtain access to the attached InputDevice in order to provide enhanced functionality via a sub class. |
void |
passivate()
Passivates the sensor. |
int |
readValue()
Reads the canonical value of the sensor. |
void |
removeSensorListener(SensorListener listener)
Remove the attached listener. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Constructor Detail |
public Sensor(int id, int type, int mode) throws NoSuchDeviceException
SensorConstants
Method Detail |
public int readValue()
public void addSensorListener(SensorListener listener)
Note that the sensor must be active if the listener is to receive notifications.
public void removeSensorListener(SensorListener listener)
public void activate()
Note that the sensor must be activatved if a listener is to receive notifications.
public final void passivate()
protected ukcrobots.core.InputDevice getDevice()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |