public static class TestCloner.GraphNode extends java.lang.Object implements java.lang.Cloneable, JmeCloneable
Constructor and Description |
---|
GraphNode(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
TestCloner.GraphNode |
addLink(java.lang.String name) |
TestCloner.GraphNode |
addLink(TestCloner.GraphNode node) |
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
void |
dump(java.lang.String indent) |
java.util.List<TestCloner.GraphNode> |
getLinks() |
TestCloner.GraphNode |
jmeClone()
Performs a regular shallow clone of the object.
|
java.lang.String |
toString() |
public void dump(java.lang.String indent)
public TestCloner.GraphNode addLink(java.lang.String name)
public TestCloner.GraphNode addLink(TestCloner.GraphNode node)
public java.util.List<TestCloner.GraphNode> getLinks()
public TestCloner.GraphNode jmeClone()
JmeCloneable
This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone
in interface JmeCloneable
public void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneable
Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields
in interface JmeCloneable
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone, and this object need only clone what it wants.public java.lang.String toString()
toString
in class java.lang.Object