| Package | com.bourre.commands |
| Interface | public interface Cancelable extends Runnable |
| Implementors | LoopCommand |
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Cancelable defines rules for Runnable
implementations whose instances process could be cancelled.
Implementers should consider the possibility for the user of the class
to cancel or not the operation, if the operation could be cancelled,
the implementer should create a Cancelable class.
More formally, an operation is cancelable if there is a need for the operation to abort during its process, or if the operation couldn't be paused(stopped) and resumed(re-started) without breaking the state of the process For example, a loading process could be stopped by an action of the user.
Implementing the Cancelable interface doesn't require anything
regarding the time outflow approach. The only requirements concerned the cancelable
nature of the process.
Note : There's no restriction concerning class which would implements both Suspendable
and Cancelable interfaces.
See also
| Method | Defined by | ||
|---|---|---|---|
|
cancel():void
Attempts to cancel execution of this task.
| Cancelable | ||
|
isCancelled():Boolean
Returns
true if the operation have been stopped
as a result of a cancel call. | Cancelable | ||
![]() |
isRunning():Boolean
Returns
true if this object is running. | Runnable | |
![]() |
run():void
Starts the asynchronous process of this runnable object.
| Runnable | |
| cancel | () | method |
public function cancel():void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Attempts to cancel execution of this task. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, this task should never run.
After this method returns, subsequent calls to isRunning
will always return false. Subsequent calls to
run will always fail with an exception. Subsequent
calls to cancel will always failed with the throw
of an exception.
— IllegalStateException — if the cancel
method have been called wheras the operation have been already
cancelled
|
| isCancelled | () | method |
public function isCancelled():Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns true if the operation have been stopped
as a result of a cancel call.
Boolean — true if the operation have been stopped
as a result of a cancel call
|