| Package | com.threerings.util |
| Interface | public interface Cloneable |
| Method | Defined by | ||
|---|---|---|---|
|
clone():Object
Create a clone of this object.
| Cloneable | ||
| clone | () | method |
public function clone():ObjectCreate a clone of this object.
ReturnsObject |
public function clone () :Object
{
var myObj :MyClass = MyClass(ClassUtil.newInstance(this)); // requires 0-arg constructor
myObj.someInt = this.someInt; // copy all vars
myObj.someArray = this.someArray.concat(); // make a clone of any mutable vars
return myObj;
}