Packageorg.springextensions.actionscript.core.task.support
SVN browsingTask.as
FisheyeTask.as
Classpublic class Task
InheritanceTask Inheritance AbstractOperation Inheritance flash.events.EventDispatcher
ImplementsIDisposable, ITask
SubclassesAbstractTaskBlock

Abstract base class for IOperation implementations.



Public Properties
 PropertyDefined by
  context : Object
An anonymous object that can be used to store values that can be accessed by other client code to pass around these values between commands.
Task
 Inheritederror : *
The error of this operation or null if no error occurred during this operation.
AbstractOperation
  failOnFault : Boolean = true
Determines if the entire controlflow of the current ITask will be aborted if an error occurs.
Task
  isDisposed : Boolean
[read-only] Returns true if the dispose() has already been invoked before.
Task
  parent : ITask
Task
 Inheritedresult : *
The result of this operation or null if the operation does not have a result.
AbstractOperation
 Inheritedtimeout : int
The timeout in milliseconds.
AbstractOperation
Protected Properties
 PropertyDefined by
  commandList : Array
Internal Array of the commands, tasks and controlflow objects that will be executed.
Task
  currentCommand : ICommand
The current ICommand instance that is being executed.
Task
  finishedCommandList : Array
Internal Array of the commands, tasks and controlflow objects that have been executed.
Task
Public Methods
 MethodDefined by
  
Task()
Creates a new Task instance.
Task
 Inherited
addCompleteListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
addErrorListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.ERROR event.
AbstractOperation
 Inherited
addTimeoutListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.TIMEOUT event.
AbstractOperation
  
and(item:Object, ... constructorArgs):ITask
Adds an ICommand that will be executed in parallel.
Task
  
Task
  
Task
 Inherited
dispatchCompleteEvent(result:* = null):Boolean
Convenience method for dispatching a OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
dispatchErrorEvent(error:* = null):Boolean
Convenience method for dispatching a OperationEvent.ERROR event.
AbstractOperation
 Inherited
Convenience method for dispatching a OperationEvent.TIMEOUT event.
AbstractOperation
  
dispose():void
Release any resources that the current object might hold a reference to.
Task
  
Switches the current IIfElseBlock control flow to its else block.
Task
  
Closes the current ITaskBlock.
Task
  
execute():*
Executes the command.
Task
  
Stops the execution chain completely.
Task
  
for_(count:uint, countProvider:ICountProvider = null, forBlock:IForBlock = null):IForBlock
Adds a repeating execution block which will be executed a specified number of times, determined by the specified count or ICountProvider parameters.
Task
  
if_(conditionProvider:IConditionProvider = null, ifElseBlock:IIfElseBlock = null):IIfElseBlock
Adds a conditional execution block to the current ITask which will only be executed if the specified IConditionProvider return true.
Task
  
next(item:Object, ... constructorArgs):ITask
Adds an ICommand that will be executed in sequence.
Task
  
pause(duration:uint, pauseCommand:ICommand = null):ITask
Pauses the current ITask for the specified amount of milliseconds.
Task
 Inherited
removeCompleteListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
removeErrorListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.ERROR event.
AbstractOperation
 Inherited
removeTimeoutListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.TIMEOUT event.
AbstractOperation
  
reset(doHardReset:Boolean = false):ITask
Restarts the execution of the current ITask.
Task
  
while_(conditionProvider:IConditionProvider = null, whileBlock:IWhileBlock = null):IWhileBlock
Adds a repeating execution block which will be executed until the specified IConditionProvider returns false.
Task
Protected Methods
 MethodDefined by
  
Examines the current ICommand in the controlflow and based on that either adds the specified ICommand to the current ICommand or creates a new TaskCommand and adds it to this.
Task
  
addCommandListeners(asyncCommand:IOperation):void
Task
  
Adds a new TaskCommand with the specified ComposeiteCommandKind to the controlflow of the current ITask.
Task
  
addToCommandList(command:ICommand):void
Adds the specified ICommand instance to the control flow of the current ITask, if the specified ICommand is also an implementation of ITask, the current ITask will be set as its parent.
Task
  
Task
  
dispatchTaskEvent(eventType:String, command:ICommand = null):void
Task
  
executeCommand(command:ICommand):void
Task
  
Task
  
Task
  
initTask():void
Task
  
Task
  
Task
  
Task
  
Task
  
Task
  
Task
 Inherited
startTimeout():void
AbstractOperation
  
Task
Events
 EventSummaryDefined by
 Inherited Dispatched when the current AbstractOperation has completed its functionality successfully.AbstractOperation
 Inherited Dispatched when the current AbstractOperation encountered an error.AbstractOperation
 Inherited Dispatched when the current AbstractOperation timed out.AbstractOperation
Property detail
commandListproperty
protected var commandList:Array

Internal Array of the commands, tasks and controlflow objects that will be executed.

contextproperty 
context:Object  [read-write]

An anonymous object that can be used to store values that can be accessed by other client code to pass around these values between commands.

Implementation
    public function get context():Object
    public function set context(value:Object):void
currentCommandproperty 
protected var currentCommand:ICommand

The current ICommand instance that is being executed.

failOnFaultproperty 
public var failOnFault:Boolean = true

Determines if the entire controlflow of the current ITask will be aborted if an error occurs.

finishedCommandListproperty 
protected var finishedCommandList:Array

Internal Array of the commands, tasks and controlflow objects that have been executed.

isDisposedproperty 
isDisposed:Boolean  [read-only]

Returns true if the dispose() has already been invoked before.

Implementation
    public function get isDisposed():Boolean
parentproperty 
parent:ITask  [read-write]

Implementation
    public function get parent():ITask
    public function set parent(value:ITask):void
Constructor detail
Task()constructor
public function Task()

Creates a new Task instance.

Method detail
addCommand()method
protected function addCommand(command:ICommand, kind:CompositeCommandKind):ITask

Examines the current ICommand in the controlflow and based on that either adds the specified ICommand to the current ICommand or creates a new TaskCommand and adds it to this.

Parameters
command:ICommand — The specified ICommand.
 
kind:CompositeCommandKind

Returns
ITask — The current ICommand if it is an ITaskBlock, otherwise null.
addCommandListeners()method 
protected function addCommandListeners(asyncCommand:IOperation):voidParameters
asyncCommand:IOperation
addTaskCommand()method 
protected function addTaskCommand(kind:CompositeCommandKind):CompositeCommand

Adds a new TaskCommand with the specified ComposeiteCommandKind to the controlflow of the current ITask.

Parameters
kind:CompositeCommandKind — The specified ComposeiteCommandKind

Returns
CompositeCommand — The newly created TaskCommand
addToCommandList()method 
protected function addToCommandList(command:ICommand):void

Adds the specified ICommand instance to the control flow of the current ITask, if the specified ICommand is also an implementation of ITask, the current ITask will be set as its parent.

Parameters
command:ICommand — The specified ICommand instance.
and()method 
public function and(item:Object, ... constructorArgs):ITask

Adds an ICommand that will be executed in parallel.

Parameters
item:Object — The specified ICommand
 
... constructorArgs

Returns
ITask — A reference to the current ITask
break_()method 
public function break_():ITask

Returns
ITask
completeExecution()method 
protected function completeExecution():void
continue_()method 
public function continue_():ITask

Returns
ITask
dispatchTaskEvent()method 
protected function dispatchTaskEvent(eventType:String, command:ICommand = null):voidParameters
eventType:String
 
command:ICommand (default = null)
dispose()method 
public function dispose():void

Release any resources that the current object might hold a reference to.

else_()method 
public function else_():IIfElseBlock

Switches the current IIfElseBlock control flow to its else block.

Returns
IIfElseBlock — The current IIfElseBlock instance.
end()method 
public function end():ITask

Closes the current ITaskBlock.

Returns
ITask — The current ITask.
execute()method 
public function execute():*

Executes the command.

Returns
*
executeCommand()method 
protected function executeCommand(command:ICommand):voidParameters
command:ICommand
executeNextCommand()method 
protected function executeNextCommand():void
exit()method 
public function exit():ITask

Stops the execution chain completely.

Returns
ITask — The current ITask.
exit_handler()method 
protected function exit_handler(event:TaskFlowControlEvent):voidParameters
event:TaskFlowControlEvent
for_()method 
public function for_(count:uint, countProvider:ICountProvider = null, forBlock:IForBlock = null):IForBlock

Adds a repeating execution block which will be executed a specified number of times, determined by the specified count or ICountProvider parameters.

Parameters
count:uint — The specified ICountProvider. This argument is ignored if the forBlock argument is not null.
 
countProvider:ICountProvider (default = null) — Optional IForBlock instance, if this is null a new instance will be created.
 
forBlock:IForBlock (default = null)

Returns
IForBlock — The new IForBlock instance.
if_()method 
public function if_(conditionProvider:IConditionProvider = null, ifElseBlock:IIfElseBlock = null):IIfElseBlock

Adds a conditional execution block to the current ITask which will only be executed if the specified IConditionProvider return true.

Parameters
conditionProvider:IConditionProvider (default = null) — The specified IConditionProvider. This argument is ignored if the ifElseBlock argument is not null.
 
ifElseBlock:IIfElseBlock (default = null) — Optional IIfElseBlock instance, if this is null a new instance will be created.

Returns
IIfElseBlock — The new IIfElseBlock instance.
initTask()method 
protected function initTask():void
next()method 
public function next(item:Object, ... constructorArgs):ITask

Adds an ICommand that will be executed in sequence.

Parameters
item:Object — The specified ICommand
 
... constructorArgs

Returns
ITask — A reference to the current ITask
onCommandFault()method 
protected function onCommandFault(event:OperationEvent):voidParameters
event:OperationEvent
onCommandResult()method 
protected function onCommandResult(event:OperationEvent):voidParameters
event:OperationEvent
pause()method 
public function pause(duration:uint, pauseCommand:ICommand = null):ITask

Pauses the current ITask for the specified amount of milliseconds.

Parameters
duration:uint — The specified amount of milliseconds
 
pauseCommand:ICommand (default = null)ICommand instance to be used as a pause command, if this parameter is not null the duration parameter is ignored.

Returns
ITask — The current ITask.
redispatchCompositeCommand()method 
protected function redispatchCompositeCommand(event:CompositeCommandEvent):voidParameters
event:CompositeCommandEvent
redispatchTaskEvent()method 
protected function redispatchTaskEvent(event:TaskEvent):voidParameters
event:TaskEvent
removeCommandListeners()method 
protected function removeCommandListeners(asyncCommand:IOperation):voidParameters
asyncCommand:IOperation
reset()method 
public function reset(doHardReset:Boolean = false):ITask

Restarts the execution of the current ITask.

Parameters
doHardReset:Boolean (default = false)

Returns
ITask — The current ITask.
resetCommandList()method 
protected function resetCommandList():void
TaskFlowControlEvent_handler()method 
protected function TaskFlowControlEvent_handler(event:TaskFlowControlEvent):voidParameters
event:TaskFlowControlEvent
while_()method 
public function while_(conditionProvider:IConditionProvider = null, whileBlock:IWhileBlock = null):IWhileBlock

Adds a repeating execution block which will be executed until the specified IConditionProvider returns false.

Parameters
conditionProvider:IConditionProvider (default = null) — The specified IConditionProvider. This argument is ignored if the whileBlock argument is not null.
 
whileBlock:IWhileBlock (default = null) — Optional IWhileBlock instance, if this is null a new instance will be created.

Returns
IWhileBlock — The new IWhileBlock instance.