Packagesystem.process
Classpublic class Cache
InheritanceCache Inheritance Task Inheritance Object

Enqueue a collection of members definitions (commands) to apply or invoke with the specified target object.

Example :

     import core.dump ;
     import system.process.Cache ;
     
     var object:Object = {} ;
     
     object.a = 1 ;
     object.b = 2 ;
     object.c = 3 ;
     object.d = 3 ;
     
     object.method1 = function( value:uint ):void
     {
         this.c = value ;
     };
     
     object.method2 = function( value1:uint , value2:uint ):void
     {
         this.d = value1 + value2 ;
     };
     
     object.setPropertyIsEnumerable("method1", false) ;
     object.setPropertyIsEnumerable("method2", false) ;
     
     trace( core.dump( object ) ) ; // {b:2,d:3,a:1,c:3}
     
     var cache:Cache = new Cache() ;
     
     cache.enqueueAttribute("a", 10) ;
     cache.enqueueAttribute("b", 20) ;
     
     cache.enqueueMethod("method1", 30) ;
     cache.enqueueMethod("method2", 40 , 50) ;
     
     cache.target = object ;
     
     cache.run() ; // flush the cache and initialize the target or invoked this methods.
     
     trace( core.dump( object ) ) ; // {b:20,c:30,d:90,a:10}
     



Public Properties
 PropertyDefined By
 InheritedfinishIt : Signaler
This signal emit when the notifyFinished method is invoked.
Task
  length : uint
[read-only] Returns the number of commands in memory.
Cache
 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
  target : *
The scope of the object.
Cache
Public Methods
 MethodDefined By
  
Cache(target:* = null, init:Vector.<Property> = null)
Creates a new Cache instance.
Cache
  
clear():void
Removes all commands in memory.
Cache
  
clone():*
[override] Creates and returns a shallow copy of the object.
Cache
  
enqueueAttribute(name:String, value:*):Cache
Enqueues an attribute name/value entry.
Cache
  
enqueueMethod(name:String, ... args):Cache
Enqueues a method definition.
Cache
  
enqueueMethodWithArguments(name:String, args:Array, rest:Array = null):Cache
Enqueues a method definition with an Array of arguments and an optional rest list of parameters..
Cache
  
isEmpty():Boolean
Indicates if the tracker cache is empty.
Cache
 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
  
run(... arguments):void
[override] Flush and invoke all the commands in memory.
Cache
 Inherited
unlock():void
Unlocks the display.
Task
Protected Methods
 MethodDefined By
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
Task
Property Detail
lengthproperty
length:uint  [read-only]

Returns the number of commands in memory.


Implementation
    public function get length():uint
targetproperty 
public var target:*

The scope of the object.

Constructor Detail
Cache()Constructor
public function Cache(target:* = null, init:Vector.<Property> = null)

Creates a new Cache instance.

Parameters
target:* (default = null) — The scope of the cache object.
 
init:Vector.<Property> (default = null)
Method Detail
clear()method
public function clear():void

Removes all commands in memory.

clone()method 
override public function clone():*

Creates and returns a shallow copy of the object.

Returns
* — A new object that is a shallow copy of this instance.
enqueueAttribute()method 
public function enqueueAttribute(name:String, value:*):Cache

Enqueues an attribute name/value entry.

Parameters

name:String
 
value:*

Returns
Cache
enqueueMethod()method 
public function enqueueMethod(name:String, ... args):Cache

Enqueues a method definition.

Parameters

name:String — The name of the method.
 
... args — The optional arguments passed-in the method.

Returns
Cache
enqueueMethodWithArguments()method 
public function enqueueMethodWithArguments(name:String, args:Array, rest:Array = null):Cache

Enqueues a method definition with an Array of arguments and an optional rest list of parameters..

Parameters

name:String — The name of the method.
 
args:Array — The Array of all arguments passed-in the method.
 
rest:Array (default = null) — The optional Array reference of rest arguments passed-in the method (if the method use a ..rest definition).

Returns
Cache
isEmpty()method 
public function isEmpty():Boolean

Indicates if the tracker cache is empty.

Returns
Boolean
run()method 
override public function run(... arguments):void

Flush and invoke all the commands in memory.

Parameters

... arguments