Packagecom.bourre.commands
Interfacepublic interface Suspendable extends Runnable
SubinterfacesTween
ImplementorsLoopCommand, SoundInfo, SoundMixer, VideoDisplay

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Suspendable defines rules for Runnable implementations whose instances process could be suspended. Implementers should consider the possibility for the user of the class to suspend or not the operation, if the operation could be suspended, the implementer should create a Suspendable class.

More formally, an operation is suspendable if and only if the operation could be paused(stopped) and resumed(re-started) without breaking the state of the process. For example, a loading process could be stopped, but it couldn't be suspended, when a file loading is stopped there's no possibility to restart it at the point it was stopped. In that logic, the only way to reset the state of a suspendable operation is to call the reset method defined in this interface.

Implementing the Suspendable interface doesn't require anything regarding the time outflow approach. The only requirements concerned the suspendable nature of the process.

Note : There's no restriction concerning class which would implements both Suspendable and Cancelable interfaces.

See also

Runnable.html
Cancelable.html


Public Methods
 MethodDefined by
 Inherited
isRunning():Boolean
Returns true if this object is running.
Runnable
  
reset():void
Resets the state of this object.
Suspendable
 Inherited
run():void
Starts the asynchronous process of this runnable object.
Runnable
  
start():void
Starts the operation of this suspendable operation.
Suspendable
  
stop():void
Stops the operation in process.
Suspendable
Method detail
reset()method
public function reset():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Resets the state of this object. The state of an operation could be reset at any time, whether it be running or stopped. Concret implementation, which not support the reset method, can choose to throw an exception or to simply ignore the call.


Throws
UnsupportedOperationException — The reset method is not supported by this implementation
start()method 
public function start():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Starts the operation of this suspendable operation. If a call to the start method is done while the operation is playing, concret class must ignore it.

stop()method 
public function stop():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Stops the operation in process. If a call to the stop method is done whereas this operation is already stopped, concret class must ignore it.