Packagevegas.util
Classpublic class ArrayUtil

Array static tool class.



Public Methods
 MethodDefined by
  
clone(ar:Array):Array
[static] Creates the shallow copy of the Array.
ArrayUtil
  
copy(ar:Array):Array
[static] Creates the deep copy of the Array.
ArrayUtil
  
toSource(ar:Array, ... rest):String
[static] Returns a string representing the source code of the array.
ArrayUtil
Method detail
clone()method
public static function clone(ar:Array):Array

Creates the shallow copy of the Array.

Example :

         import vegas.util.ArrayUtil ;
         
         var ar1:Array = [ [2, 3, 4] , [5, 6, 7] ] ;
         var ar2:Array = ArrayUtil.clone(ar1) ;
         
         trace( 'clone : ' + ar1 + " : " + ar2 ) ; // 2,3,4,5,6,7
         trace( 'ar1 == ar2 : ' + ( ar1 == ar2 ) ) ; // false
         trace( 'ar1[0] == ar2[0] : ' + ( ar1[0] == ar2[0] ) ) ; // true
         
Parameters
ar:Array

Returns
Array — the shallow copy of the Array.
copy()method 
public static function copy(ar:Array):Array

Creates the deep copy of the Array.

Example :

         import vegas.util.ArrayUtil ;
         
         var ar1:Array = [ [2, 3, 4] , [5, 6, 7] ] ;
         var ar2:Array = ArrayUtil.copy(ar1) ;
         
         trace( 'copy : ' + ar1 + " : " + ar2 ) ; // 2,3,4,5,6,7
         trace( 'ar1 == ar2 : ' + ( ar1 == ar2 ) ) ; // false
         trace( 'ar1[0] == ar2[0] : ' + ( ar1[0] == ar2[0] ) ) ; // false
         
Parameters
ar:Array

Returns
Array — the deep copy of the Array.
toSource()method 
public static function toSource(ar:Array, ... rest):String

Returns a string representing the source code of the array.

Parameters
ar:Array
 
... rest

Returns
String — a string representing the source code of the array.