Interface Actionable
-
- All Known Implementing Classes:
ActionableTest
,Blinker
,Blinker
,BlueRS
,BlueRSCmdInt
,BlueRSCmdIntDemo
,BlueRSDemo
,CAN1Test
,DateTime
,EPOStest1
,ExceptionDemo
,FileTransfer
,FlinkDemo
,FlinkDemo
,HD44780U
,HD44780U
,HLC1395Demo
,HLC1395Pulsed
,MotorDemo
,MotorDemo1
,RN131
,RN131
,Robi2
,Robi2LedBlinkerDemo
,Robi2LineTask
,Robi2MotorDemo
,Robi2ObstacleTask
,Robi2SensorProximityDemo_Led
,Robi2SensorProximityDemo_Out
,SimpleBlinkerDemo
,SimpleBlinkerDemo
,SPIDemo
,SystemInOutReflector
,SystemInOutReflector
,SystemOutDemo
,SystemOutDemo1
,SystemOutDemo2
,Task
,Task
,TCRT1000
,TCRT1000Demo
,UART3Demo
,UART3InOutReflector
,UART6Demo
,VL53L0X
,VL53L0XDemo
,VL53L0XTest
,WatchdogDemo
,WatchdogTask
,WifiDemo
,WifiDemo
public interface Actionable
TheActionable
interface should be implemented by any class whose instances are intended to be executed by a task. The class must define a method of no arguments calledaction
.This interface is designed to provide a common protocol for objects that wish to execute code while they are active. For example,
Actionable
is implemented by classTask
. Being active simply means that a task has been started and has not yet been stopped.In addition,
Actionable
provides the means for a class to be active while not subclassingTask
. A class that implementsActionable
can run without subclassingTask
by instantiating aTask
instance and passing itself in as the target. In most cases, theActionable
interface should be used if you are only planning to override theaction()
method and no otherTask
methods. This is important because classes should not be subclassed unless the programmer intends on modifying or enhancing the fundamental behavior of the class.- Author:
- Urs Graf
- See Also:
Task
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
action()
When an object implementing interfaceActionable
is used to create a task, starting the task causes the object'saction
method to be called in that separately executing action.
-