Packagesystem.logic
Classpublic class IfEmptyString
InheritanceIfEmptyString Inheritance IfTask Inheritance Task Inheritance Object

Perform some tasks based on whether a given value is an empty string ("").

Example :

                  
     package examples
     {
         import system.process.logic.IfEmptyString;
         
         import flash.display.Sprite;
         
         public class IfEmptyStringExample extends Sprite
         {
             public function IfEmptyStringExample()
             {
                 var task:IfEmptyString ;
                 
                 var value:String ;
                 
                 task = new IfEmptyString( value , new Then(), new Else() ) ;
                 task.run() ; // else
                 
                 value = "" ;
                 
                 task = new IfEmptyString( value , new Then(), new Else() ) ;
                 task.run() ; // then
                 
                 value = "hello" ;
                 
                 task = new IfEmptyString( value , new Then(), new Else() ) ;
                 task.run() ; // then
             }
         }
     }
     
     import system.process.Task;
     
     class Then extends Task 
     {
         public function Then() {}
         
         public override function run( ...arguments:Array ):void
         {
             notifyStarted() ;
             trace( "then" ) ;
             notifyFinished() ;
         }
     }
     
     class Else extends Task 
     {
         public function Else() {}
         
         public override function run( ...arguments:Array ):void
         {
             notifyStarted() ;
             trace( "else" ) ;
             notifyFinished() ;
         }
     }
     
               

See also

system.rules.EmptyString


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
  
IfEmptyString(value:*, thenTask:Action = null, elseTask:Action = null, ... elseIfTasks)
Creates a new IfEmptyString instance.
IfEmptyString
 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
IfEmptyString()Constructor
public function IfEmptyString(value:*, thenTask:Action = null, elseTask:Action = null, ... elseIfTasks)

Creates a new IfEmptyString instance.

Parameters
value:* — The 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.