Packageorg.spicefactory.lib.task
Classpublic class TaskGroup
InheritanceTaskGroup Inheritance Task Inheritance flash.events.EventDispatcher
Subclasses ConcurrentTaskGroup, SequentialTaskGroup

Abstract base class for SequentialTaskGroup and ConcurrentTaskGroup. Manages multiple child tasks and is itself a subclass of Task (Composite Design Pattern) so that it can be nested within other TaskGroups.



Public Properties
 PropertyDefined By
  autoStart : Boolean
Indicates whether this TaskGroup starts automatically when the first child is added.
TaskGroup
 Inheritedcancelable : Boolean
[read-only] Indicates whether this Task can be cancelled.
Task
 Inheriteddata : *
An arbitrary value associated with this Task.
Task
  ignoreChildErrors : Boolean
Indicates whether ERROR events of child tasks should be ignored or if they should stop the whole group.
TaskGroup
 Inheritedparent : TaskGroup
[read-only] The parent of this Task.
Task
 Inheritedrestartable : Boolean
[read-only] Indicates whether this Task can be restarted.
Task
 Inheritedroot : Task
[read-only] The root TaskGroup in case this Task is nested in one or more TaskGroups.
Task
  size : uint
[read-only] The number of tasks added to this TaskGroup.
TaskGroup
 Inheritedskippable : Boolean
[read-only] Indicates whether this Task can be forced to skip to its final state.
Task
 Inheritedstate : TaskState
[read-only] The current state of this Task.
Task
 Inheritedsuspendable : Boolean
[read-only] Indicates whether this Task can be suspended.
Task
  timeout : uint
TaskGroup
Public Methods
 MethodDefined By
  
addTask(task:Task):Boolean
Adds the specified task to this TaskGroup.
TaskGroup
 Inherited
cancel():Boolean
Cancels this Task.
Task
  
getTask(index:uint):Task
Returns the Task at the specified index.
TaskGroup
  
Removes all tasks from this TaskGroup.
TaskGroup
  
removeTask(task:Task):Boolean
Removes the specified task from this TaskGroup.
TaskGroup
 Inherited
resume():Boolean
Resumes this Task if it is suspended.
Task
 Inherited
skip():Boolean
Forces this Task to move to its final state.
Task
 Inherited
start():Boolean
Starts this Task.
Task
 Inherited
suspend():Boolean
Suspends this Task.
Task
Protected Methods
 MethodDefined By
 Inherited
complete():Boolean
Signals that this Task has completed.
Task
 Inherited
doCancel():void
Called before the CANCEL event gets fired.
Task
 Inherited
doError(message:String):void
Called before the ERROR event gets fired.
Task
 Inherited
doResume():void
Called before the RESUME event gets fired.
Task
 Inherited
doSkip():void
Called after skip has been called but before the COMPLETE event gets fired.
Task
 Inherited
doStart():void
Called before the START event gets fired.
Task
 Inherited
doSuspend():void
Called before the SUSPEND event gets fired.
Task
 Inherited
doTimeout():void
Called before the ERROR event gets fired after a timeout occurred.
Task
 Inherited
error(message:String):Boolean
Signals an error condition and cancels the Task.
Task
  
Method hook for subclasses that gets called when a child Task was added to this TaskGroup.
TaskGroup
  
Method hook for subclasses that gets called when all child tasks have been removed from this TaskGroup.
TaskGroup
  
handleRemovedTask(task:Task, index:uint):void
Method hook for subclasses that gets called when a child Task was removed from this TaskGroup.
TaskGroup
  
Method hook for subclasses that gets called when a child Task has completed its operation.
TaskGroup
 Inherited
setCancelable(value:Boolean):void
Specifies whether this Task can be cancelled.
Task
 Inherited
setName(name:String):void
Sets the name of this Task.
Task
 Inherited
setRestartable(value:Boolean):void
Specifies whether this Task can be restarted.
Task
 Inherited
setSkippable(value:Boolean):void
Specifies whether this Task can be forced to skip to its final state.
Task
 Inherited
setSuspendable(value:Boolean):void
Specifies whether this Task can be suspended.
Task
 Inherited
setTimeout(value:uint):void
Sets the timeout for this Task in milliseconds.
Task
  
startTask(task:Task):void
Starts the specified child Task.
TaskGroup
Events
 Event Summary Defined By
 InheritedDispatched when a Task is cancelled.Task
 InheritedDispatched when a Task has completed its execution.Task
 InheritedDispatched when a Task has aborted due to an error condition.Task
 InheritedDispatched when a suspended Task is resumed.Task
 InheritedDispatched when a Task is started.Task
 InheritedDispatched when a Task is suspended.Task
Property Detail
autoStartproperty
autoStart:Boolean

Indicates whether this TaskGroup starts automatically when the first child is added. This option may be useful for queueing tasks that must not run concurrently but should be executed as soon as possible.


Implementation
    public function get autoStart():Boolean
    public function set autoStart(value:Boolean):void
ignoreChildErrorsproperty 
ignoreChildErrors:Boolean

Indicates whether ERROR events of child tasks should be ignored or if they should stop the whole group.


Implementation
    public function get ignoreChildErrors():Boolean
    public function set ignoreChildErrors(value:Boolean):void
sizeproperty 
size:uint  [read-only]

The number of tasks added to this TaskGroup.


Implementation
    public function get size():uint
timeoutproperty 
timeout:uint


Implementation
    public function get timeout():uint
    public function set timeout(value:uint):void
Method Detail
addTask()method
public function addTask(task:Task):Boolean

Adds the specified task to this TaskGroup.

Parameters

task:Task — the Task to be added to this TaskGroup

Returns
Boolean — true if the Task was successfully added to this TaskGroup
getTask()method 
public function getTask(index:uint):Task

Returns the Task at the specified index.

Parameters

index:uint — the zero-based index of the Task to return.

Returns
Task — the Task at the specified index
handleAddedTask()method 
protected function handleAddedTask(t:Task):void

Method hook for subclasses that gets called when a child Task was added to this TaskGroup.

Parameters

t:Task — the Task that was added to this TaskGroup

handleRemoveAll()method 
protected function handleRemoveAll():void

Method hook for subclasses that gets called when all child tasks have been removed from this TaskGroup.

handleRemovedTask()method 
protected function handleRemovedTask(task:Task, index:uint):void

Method hook for subclasses that gets called when a child Task was removed from this TaskGroup.

Parameters

task:Task — the Task that was removed from this TaskGroup
 
index:uint — the zero-based index of the removed Task

handleTaskComplete()method 
protected function handleTaskComplete(task:Task):void

Method hook for subclasses that gets called when a child Task has completed its operation.

Parameters

task:Task — the Task that has completed its operation

removeAllTasks()method 
public function removeAllTasks():void

Removes all tasks from this TaskGroup.

removeTask()method 
public function removeTask(task:Task):Boolean

Removes the specified task from this TaskGroup.

Parameters

task:Task — the Task to be removed from this TaskGroup

Returns
Boolean — false if the Task was successfully removed from this TaskGroup
startTask()method 
protected function startTask(task:Task):void

Starts the specified child Task.

Parameters

task:Task — the Task that should be started