Packagesystem.logic
Classpublic class IfEquals
InheritanceIfEquals Inheritance IfTask Inheritance Task Inheritance Object

Perform some tasks based on whether a given condition holds equality of two values.

Example :

                  
     package examples
     {
         import examples.process.Message;
         import flash.display.Sprite;
         import system.process.logic.IfEquals;
         
         public class IfEqualsExample extends Sprite
         {
             public function IfEqualsExample()
             {
                 var a:uint = 10 ;
                 var b:uint = 20 ;
                 
                 var task:IfEquals ;
                 
                 task = new IfEquals( a , a , new Message("then"), new Message("else")) ;
                 task.run() ; // then
                 
                 task = new IfEquals( a , b , new Message("then"), new Message("else")) ;
                 task.run() ; // else
             }
         }
     }
     
               

See also

system.rules.Equals


Public Properties
 PropertyDefined By
 InheritedfinishIt : Signaler
This signal emit when the notifyFinished method is invoked.
Task
 Inheritedlogger : Logger
Determinates the internal Logger reference of this Loggable object.
Task
 Inheritedphase : String
[read-only] The current phase of the action.
Task
 Inheritedrunning : Boolean
[read-only] Indicates true if the process is in progress.
Task
 InheritedstartIt : Signaler
This signal emit when the notifyStarted method is invoked.
Task
 InheritedthrowError : Boolean
Indicates if the class throws errors or notify a finished event when the task failed.
IfTask
Public Methods
 MethodDefined By
  
IfEquals(value1:*, value2:*, thenTask:Action = null, elseTask:Action = null, ... elseIfTasks)
Creates a new IfEquals instance.
IfEquals
 Inherited
Defines the action when the condition block use the else condition.
IfTask
 Inherited
addElseIf(... elseIfTask):IfTask
Defines an action when the condition block use the elseif condition.
IfTask
 Inherited
addRule(rule:*):IfTask
Defines the main conditional rule of the task.
IfTask
 Inherited
Defines the action when the condition block success and must run the 'then' action.
IfTask
 Inherited
clone():*
[override] Returns the shallow copy of the object.
IfTask
 Inherited
isLocked():Boolean
Returns true if the object is locked.
Task
 Inherited
lock():void
Locks the object.
Task
 Inherited
Notify an ActionEvent when the process is finished.
Task
 Inherited
Notify an ActionEvent when the process is started.
Task
 Inherited
Removes the 'then' action.
IfTask
 Inherited
Removes the 'else' action.
IfTask
 Inherited
Removes the 'conditional rule' of the task.
IfTask
 Inherited
Removes the 'then' action.
IfTask
 Inherited
run(... arguments):void
[override] Run the process.
IfTask
 Inherited
unlock():void
Unlocks the display.
Task
Protected Methods
 MethodDefined By
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
Task
Constructor Detail
IfEquals()Constructor
public function IfEquals(value1:*, value2:*, thenTask:Action = null, elseTask:Action = null, ... elseIfTasks)

Creates a new IfEquals instance.

Parameters
value1:* — The first value to evaluate.
 
value2:* — The second value to evaluate.
 
thenTask:Action (default = null) — The Action reference to defines the 'then' block in the 'if' conditional task.
 
elseTask:Action (default = null) — The Action reference to defines the 'else' block in the 'if' conditional task.
 
... elseIfTasks — The Array of ElseIf instance to initialize the 'elseif' blocks in the 'if' conditional task.