net.java.dev.joode
Class ClonedReferences

java.lang.Object
  extended by net.java.dev.joode.ClonedReferences

public class ClonedReferences
extends java.lang.Object

Helper class that manages a single clone session.

Author:
Tom Larkworthy

Constructor Summary
ClonedReferences()
           
 
Method Summary
 void addClone(SimState obj, SimState clone)
          Registers an object as a clone of an object reference.
 SimState getClone(SimState object)
          Returns a valid cloned reference for the clone session for an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClonedReferences

public ClonedReferences()
Method Detail

getClone

public SimState getClone(SimState object)
Returns a valid cloned reference for the clone session for an object. The first time this is called for an object reference it returns a clone of that reference. Subsequant calls this method returns the earlier result; public World cloneState(ClonedReferences clones){ World clone = new World(); clones.addClone(this, clone); ... for(int i=0;i


addClone

public void addClone(SimState obj,
                     SimState clone)
Registers an object as a clone of an object reference. This is normally called as the second line of an implementation of simState.cloneState public World cloneState(ClonedReferences clones){ World clone = new World(); clones.addClone(this, clone); ... }