at.dms.kjc
Class ObjectDeepCloner

java.lang.Object
  extended by at.dms.kjc.ObjectDeepCloner

public class ObjectDeepCloner
extends Object

This class implements general deep cloning using the serializable interface


Method Summary
static Object deepCopy(int offset, JBlock oldObj)
          Clone everything starting from this offset of the block Useful in BranchAnalyzer
static Object deepCopy(JPhylum oldObj)
          Deep copy a KJC structure.
static JPhylum[] deepCopy(JPhylum[] oldObj)
          Deep copy an array of KJC structures.
static Object deepCopy(SIRStream oldObj)
          Deep copy a stream structure.
static Object getHandle(Object oldInstance)
          Return a handle for
static Object getInstance(Object handle, Object newInstance)
          Given that
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

deepCopy

public static Object deepCopy(SIRStream oldObj)
Deep copy a stream structure.


deepCopy

public static Object deepCopy(JPhylum oldObj)
Deep copy a KJC structure.


deepCopy

public static Object deepCopy(int offset,
                              JBlock oldObj)
Clone everything starting from this offset of the block Useful in BranchAnalyzer


deepCopy

public static JPhylum[] deepCopy(JPhylum[] oldObj)
Deep copy an array of KJC structures. Assumes that all the elements of the array are of the same type.


getHandle

public static Object getHandle(Object oldInstance)
Return a handle for
oldInstance
that it can store to protect its identity across a serialization operation.


getInstance

public static Object getInstance(Object handle,
                                 Object newInstance)
Given that
newInstance
finds itself being unserialized, this method returns what its new representation should be given that it was handed
handle
prior to the serialization.