Package com.jme3.util.clone
Class ListCloneFunction<T extends List>
java.lang.Object
com.jme3.util.clone.ListCloneFunction<T>
- All Implemented Interfaces:
CloneFunction<T>
A CloneFunction implementation that deep clones a list by
creating a new list and cloning its values using the cloner.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneFields
(Cloner cloner, T clone, T object) Clones the elements of the list.cloneObject
(Cloner cloner, T object) Performs a shallow clone of the specified object.
-
Constructor Details
-
ListCloneFunction
public ListCloneFunction()
-
-
Method Details
-
cloneObject
Description copied from interface:CloneFunction
Performs a shallow clone of the specified object. This is similar to the JmeCloneable.clone() method in semantics and is the first part of a two part cloning process. Once the shallow clone is created, it is cached and CloneFunction.cloneFields() is called. In this way, the CloneFunction interface can completely take over the JmeCloneable style cloning for an object that doesn't otherwise implement that interface.- Specified by:
cloneObject
in interfaceCloneFunction<T extends List>
- Parameters:
cloner
- The cloner performing the cloning operation.object
- The original object that needs to be cloned.- Returns:
- a new instance
-
cloneFields
Clones the elements of the list.- Specified by:
cloneFields
in interfaceCloneFunction<T extends List>
- 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.
-