Packagesystem.data.arrays
Classpublic dynamic class ProxyArray
InheritanceProxyArray Inheritance flash.utils.Proxy
Implements Cloneable, Iterable, Serializable
Subclasses TypedArray

The ProxyArray class extends the flash.utils.Proxy class and use a composition with an Array to extends the Array class.

Example :

     import system.data.arrays.ProxyArray ;
     
     var a1:ProxyArray = new ProxyArray() ;
     
     a1.push("item1") ;
     a1.push("item2") ;
     a1.push("item3") ;
     a1.push("item4") ;
     
     for (var prop:String in a1)
     {
         trace( prop + " : " + a1[prop] ) ;
     }
     
     trace("----") ;
     
     for each( var item:in a1)
     {
         trace(  item ) ;
     }
     
     trace("----") ;
     
     trace("proxy array toString : " + a1) ;
     trace("proxy array toSource : " + a1.toSource()) ;
     
     var a2:ProxyArray = new ProxyArray( [[1, 2], [0, 4]] ) ;
     
     var copy:ProxyArray = a2.copy() ;
     copy[1][0] = 3 ;
     copy[2] = [5,6] ;
     copy[3] = [7,8] ;
     
     trace(a2 + " : " + copy) ;
     



Protected Properties
 PropertyDefined By
  _ar : Array
Internal Array reference used in the proxy pattern.
ProxyArray
Public Methods
 MethodDefined By
  
ProxyArray(datas:Array = null)
Creates a new ProxyArray instance.
ProxyArray
  
clear():void
Removes all elements in the array.
ProxyArray
  
clone():*
Creates and returns a shallow copy of the object.
ProxyArray
  
isEmpty():Boolean
Indicates if the array is empty or not.
ProxyArray
  
Returns the iterator of the object.
ProxyArray
  
toArray():Array
Returns the Array representation of the object.
ProxyArray
  
toSource(indent:int = 0):String
Returns the source code string representation of the object.
ProxyArray
  
toString():String
Returns the source code string representation of the object.
ProxyArray
Protected Methods
 MethodDefined By
  
callProperty(methodName:*, ... rest):*
[override] Overrides the behavior of an object property that can be called as a function.
ProxyArray
  
getProperty(name:*):*
[override] Overrides any request for a property's value.
ProxyArray
  
nextName(index:int):String
[override] Allows enumeration of the proxied object's properties by index number to retrieve property names.
ProxyArray
  
nextNameIndex(index:int):int
[override] Allows enumeration of the proxied object's properties by index number.
ProxyArray
  
nextValue(index:int):*
[override] Allows enumeration of the proxied object's properties by index number to retrieve property values.
ProxyArray
  
setProperty(name:*, value:*):void
[override] Overrides a call to change a property's value.
ProxyArray
Property Detail
_arproperty
protected var _ar:Array

Internal Array reference used in the proxy pattern.

Constructor Detail
ProxyArray()Constructor
public function ProxyArray(datas:Array = null)

Creates a new ProxyArray instance.

Parameters
datas:Array (default = null)
Method Detail
callProperty()method
override flash_proxy function callProperty(methodName:*, ... rest):*

Overrides the behavior of an object property that can be called as a function. When a method of the object is invoked, this method is called. While some objects can be called as functions, some object properties can also be called as functions.

Parameters

methodName:*
 
... rest

Returns
*
clear()method 
public function clear():void

Removes all elements in the array.

clone()method 
public function clone():*

Creates and returns a shallow copy of the object.

Returns
* — a shallow copy of the object.
getProperty()method 
override flash_proxy function getProperty(name:*):*

Overrides any request for a property's value. If the property can't be found, the method returns undefined. For more information on this behavior, see the ECMA-262 Language Specification, 3rd Edition.

Parameters

name:*

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

Indicates if the array is empty or not.

Returns
Booleantrue if the array is empty.
iterator()method 
public function iterator():Iterator

Returns the iterator of the object.

Returns
Iterator — the iterator of the object.
nextName()method 
override flash_proxy function nextName(index:int):String

Allows enumeration of the proxied object's properties by index number to retrieve property names. However, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve the desired names.

Parameters

index:int

Returns
String
nextNameIndex()method 
override flash_proxy function nextNameIndex(index:int):int

Allows enumeration of the proxied object's properties by index number. However, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve property index values.

Parameters

index:int

Returns
int
nextValue()method 
override flash_proxy function nextValue(index:int):*

Allows enumeration of the proxied object's properties by index number to retrieve property values. However, you cannot enumerate the properties of the Proxy class themselves. This function supports implementing for...in and for each..in loops on the object to retrieve the desired values.

Parameters

index:int

Returns
*
setProperty()method 
override flash_proxy function setProperty(name:*, value:*):void

Overrides a call to change a property's value. If the property can't be found, this method creates a property with the specified name and value.

Parameters

name:* — The name of the property to modify.
 
value:* — The value to set the property to.

toArray()method 
public function toArray():Array

Returns the Array representation of the object.

Returns
Array — the Array representation of the object.
toSource()method 
public function toSource(indent:int = 0):String

Returns the source code string representation of the object.

Parameters

indent:int (default = 0)

Returns
String — the source code string representation of the object.
toString()method 
public function toString():String

Returns the source code string representation of the object.

Returns
String — the source code string representation of the object.