|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
interfaces.Controller
Interface class for all controllers. All Controllers must extend this abstract class, and should obey the commands specified or system behaviour is undefined. e.g. a call to halt() *must* stop this controller's thread as quickly as possible and allow run() to return.
Field Summary | |
static int |
SENSOR_TYPE_LIGHT
Constant for sensor of type light. |
static int |
SENSOR_TYPE_TOUCH
Constant for sensor of type touch. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Controller()
|
Method Summary | |
abstract AbstractRobot |
getRobot()
Returns the AbstractRobot associated with this controller |
abstract int[] |
getSensors()
Returns an array of the sensors used by this controller, and the type of sensor required. |
abstract void |
halt()
Stops this controller's thread running, i.e. |
abstract void |
initController(AbstractRobot r)
Initialises controller. |
abstract void |
lightSensorListener(int sensorNumber)
This method is called whenever a LIGHT SENSOR detects change from its previous value. |
abstract void |
run()
Starts this controller's thread running. |
abstract void |
setTimerExecution(int elapsedTimer)
Whenever a timer elapses this method is called and the timer which elapsed is passed as a parameter |
abstract void |
touchSensorListener(int sensorNumber)
This method is called whenever a TOUCH SENSOR detects change from its previous value. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static int SENSOR_TYPE_LIGHT
public static int SENSOR_TYPE_TOUCH
Constructor Detail |
public Controller()
Method Detail |
public abstract void initController(AbstractRobot r)
r
- the AbstractRobot associated with this controllerpublic abstract AbstractRobot getRobot()
public abstract int[] getSensors()
public abstract void halt()
public abstract void lightSensorListener(int sensorNumber)
sensorNumber
- this is the LIGHT SENSOR number that called this methodpublic abstract void touchSensorListener(int sensorNumber)
sensorNumber
- this is the TOUCH SENSOR number that called this methodpublic abstract void run()
public abstract void setTimerExecution(int elapsedTimer)
elapsedTimer
- the timer which elapsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |