| Package | vegas.utils |
| Class | public class Copier |
| Inheritance | Copier Object |
Copier utility class is an all-static class with a method to returns a copy representation of an object.
| Method | Defined 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 | ||
| 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:* |
* — a deep copy of the specified object passed in argument.
|
| copyArray | () | method |
public static function copyArray(ar:Array):ArrayCreates 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 |
Array — the deep copy of the specified Array.
|