ukcrobots.core
Class BooleanSensorListener

java.lang.Object
  |
  +--ukcrobots.core.BooleanSensorListener
All Implemented Interfaces:
SensorListener

public abstract class BooleanSensorListener
extends Object
implements SensorListener

An abstract class for listeners on Boolean sensors, such as touch sensors. This adds a boolean version of stateChanged to the SensorListener interface.

Version:
2001.12.20
Author:
d.j.barnes @at@ kent.ac.uk

Constructor Summary
BooleanSensorListener()
           
 
Method Summary
abstract  void stateChanged(boolean oldValue, boolean newValue)
          Notify on a change of device state.
 void stateChanged(int oldValue, int newValue)
          This method maps underlying integer values from the sensor as boolean values and invokes the boolean version of stateChanged.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

BooleanSensorListener

public BooleanSensorListener()
Method Detail

stateChanged

public abstract void stateChanged(boolean oldValue,
                                  boolean newValue)
Notify on a change of device state.

Parameters:
oldValue - The previous value of the device.
newValue - The new value of the device.

stateChanged

public void stateChanged(int oldValue,
                         int newValue)
This method maps underlying integer values from the sensor as boolean values and invokes the boolean version of stateChanged.

Specified by:
stateChanged in interface SensorListener
Parameters:
oldValue - The old sensor value.
newValue - The new sensor value.