Packagecom.adobe.cairngorm.task
Classpublic class Task
InheritanceTask Inheritance flash.events.EventDispatcher
Implements ITask
Subclasses ChessTaskBase, TaskGroup, UpdateChessPiecesTask, UpdatePiecesBitboardTask, UpdatePiecesOmenVoTask, UpdatePiecesPositionTask, UpdateZobristKeysTask

Base-class for a tasks that perform some processing and can be placed inside task groups.

The abstract performTask() method must be implemented by concrete sub-classes, and the complete() or fault() methods invoked to indicate that the processing has completed or failed.

The progress method may optionally be invoked to provide fine-grained progress updates. The base-class will dispatch an initial and final progress event for 0% complete and 100% complete, assuming the task completes successfully.



Public Properties
 PropertyDefined By
  currentState : String
[read-only]
Task
  enabled : Boolean
Task
  label : String
Task
Public Methods
 MethodDefined By
  
start():void
Task
Protected Methods
 MethodDefined By
  
complete():void
This should be called by a concrete sub-class to indicate that the task has been completed.
Task
  
fault(message:String = null):void
This should be called by a concrete sub-class to indicate that the task has been halted due to a fault.
Task
  
This abstract template method must be implemented by a concrete sub-class to perform the task associated with the task.
Task
Events
 Event Summary Defined By
  Task
  Task
  Task
  Task
Property Detail
currentStateproperty
currentState:String  [read-only]


Implementation
    public function get currentState():String
enabledproperty 
enabled:Boolean


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
labelproperty 
label:String


Implementation
    public function get label():String
    public function set label(value:String):void
Method Detail
complete()method
protected function complete():void

This should be called by a concrete sub-class to indicate that the task has been completed. It should only be called once and subsequent calls are ignored.

fault()method 
protected function fault(message:String = null):void

This should be called by a concrete sub-class to indicate that the task has been halted due to a fault. It should only be called once and subsequent calls are ignored.

Parameters

message:String (default = null) — an optional message describing the cause of the fault

performTask()method 
protected function performTask():void

This abstract template method must be implemented by a concrete sub-class to perform the task associated with the task. The task may be synchronous or asynchronous. When the task is completed, the complete() method must be called, unless a fault has occurred, in which case the fault() method must be called instead.

start()method 
public function start():void

Event Detail
currentStateChange Event
Event Object Type: mx.events.StateChangeEvent

taskComplete Event  
Event Object Type: com.adobe.cairngorm.task.TaskEvent

taskFault Event  
Event Object Type: com.adobe.cairngorm.task.TaskEvent

taskStart Event  
Event Object Type: com.adobe.cairngorm.task.TaskEvent