Clone an Object if possible. * This method returns an Object which is a clone of the input object. It checks if the method implements the Cloneable interface and then uses reflection to invoke the clone method. This can't be done directly since as far as the compiler is concerned the clone method for Object is protected and someone could implement Cloneable but leave the clone method protected. The cloning can fail in a variety of ways which are trapped so that it returns null instead. This method will generally create a shallow clone. If you wish a deep copy of an array the method DeepClone should be used. *
Namespace: nom.tam.util
Assembly: CSharpFITS_v1.1 (in CSharpFITS_v1.1.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function GenericClone( _ ByVal o As Object _ ) As Object |
C# |
---|
public static object GenericClone( object o ) |
C++ |
---|
public: static Object GenericClone( Object o ) |
J# |
---|
public static object GenericClone( object o ) |
JScript |
---|
public static
function GenericClone( o : Object ) : Object |
Parameters
- o
- The object to be cloned.