Package com.jme3.util.clone
Class IdentityCloneFunction<T>
java.lang.Object
com.jme3.util.clone.IdentityCloneFunction<T>
- All Implemented Interfaces:
CloneFunction<T>
A CloneFunction implementation that simply returns
the passed object without cloning it. This is useful for
forcing some object types (like Meshes) to be shared between
the original and cloned object graph.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneFields
(Cloner cloner, T clone, T object) Does nothing.cloneObject
(Cloner cloner, T object) Returns the object directly.
-
Constructor Details
-
IdentityCloneFunction
public IdentityCloneFunction()
-
-
Method Details
-
cloneObject
Returns the object directly.- Specified by:
cloneObject
in interfaceCloneFunction<T>
- Parameters:
cloner
- The cloner performing the cloning operation.object
- The original object that needs to be cloned.- Returns:
- a new instance
-
cloneFields
Does nothing.- Specified by:
cloneFields
in interfaceCloneFunction<T>
- Parameters:
cloner
- The cloner performing the cloning operation.clone
- The clone previously returned from cloneObject().object
- The original object that was cloned. This is provided for the very special case where field cloning needs to refer to the original object. Mostly the necessary fields should already be on the clone.
-