Packagevegas.utils
Classpublic class Copier
InheritanceCopier Inheritance Object

The Copier utility class is an all-static class with a method to returns a copy representation of an object.



Public Methods
 MethodDefined By
  
copy(o:*):*
[static] Returns a deep copy of the specified object passed in argument.
Copier
  
copyArray(ar:Array):Array
[static] Creates the deep copy of the specified Array.
Copier
Method Detail
copy()method
public static function copy(o:*):*

Returns a deep copy of the specified object passed in argument. You can use a ICopyable instance or a native object.

Parameters

o:*

Returns
* — a deep copy of the specified object passed in argument.
copyArray()method 
public static function copyArray(ar:Array):Array

Creates the deep copy of the specified Array.

Example :

         import vegas.util.Copier ;
         
         var ar1:Array = [ [2, 3, 4] , [5, 6, 7] ] ;
         var ar2:Array = Copier.copyArray( 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 specified Array.