jef.deepCopier.impl
Class StatefulDeepCopier

java.lang.Object
  extended by jef.deepCopier.impl.StatefulDeepCopier
All Implemented Interfaces:
DeepCopier

public class StatefulDeepCopier
extends java.lang.Object
implements DeepCopier

This class is in charge of copying chains of cp_infos from a source Constant Pool Table to a destination Constant Pool Table.

Author:
Francesco Russo frusso@dev.java.net

Constructor Summary
StatefulDeepCopier()
          Creates a new instance of StatefulDeepCopier
 
Method Summary
 int deepCopy(int index)
          Copies the chain of cp_infos starting at index from the srcCpt to the dstCpt.
 int deepCopy(int index, boolean duplicate)
          Copies the chain of cp_infos starting at index from the srcCpt to the dstCpt.
 ConstantPoolTable getDstCpt()
          Gets the destination ConstantPoolTable instance, that is the ConstantPoolTable the cp_info-chain should be copied to.
 ConstantPoolTable getSrcCpt()
          Gets the source ConstantPoolTable instance, that is the ConstantPoolTable containing the cp_info to be copied to the destination ConstantPoolTable instance.
 void setDstCpt(ConstantPoolTable cpt)
          Sets the destination ConstantPoolTable instance, that is the ConstantPoolTable the cp_info-chain should be copied to.
 void setSrcCpt(ConstantPoolTable cpt)
          Sets the source ConstantPoolTable instance, that is the ConstantPoolTable containing the cp_info to be copied to the destination ConstantPoolTable instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulDeepCopier

public StatefulDeepCopier()
Creates a new instance of StatefulDeepCopier

Method Detail

setSrcCpt

public void setSrcCpt(ConstantPoolTable cpt)
Sets the source ConstantPoolTable instance, that is the ConstantPoolTable containing the cp_info to be copied to the destination ConstantPoolTable instance.

Specified by:
setSrcCpt in interface DeepCopier
Parameters:
cpt - The source ConstantPoolTable instance

getSrcCpt

public ConstantPoolTable getSrcCpt()
Gets the source ConstantPoolTable instance, that is the ConstantPoolTable containing the cp_info to be copied to the destination ConstantPoolTable instance.

Specified by:
getSrcCpt in interface DeepCopier
Returns:
ConstantPoolTable The source ConstantPoolTable instance

setDstCpt

public void setDstCpt(ConstantPoolTable cpt)
Sets the destination ConstantPoolTable instance, that is the ConstantPoolTable the cp_info-chain should be copied to.

Specified by:
setDstCpt in interface DeepCopier
Parameters:
cpt - The destination ConstantPoolTable instance

getDstCpt

public ConstantPoolTable getDstCpt()
Gets the destination ConstantPoolTable instance, that is the ConstantPoolTable the cp_info-chain should be copied to.

Specified by:
getDstCpt in interface DeepCopier
Returns:
ConstantPoolTable The destination ConstantPoolTable instance

deepCopy

public int deepCopy(int index)
             throws DeepCopyException,
                    java.lang.CloneNotSupportedException
Description copied from interface: DeepCopier
Copies the chain of cp_infos starting at index from the srcCpt to the dstCpt.

Specified by:
deepCopy in interface DeepCopier
Parameters:
index - The index in the source ConstantPoolTable from which the copy has to be started
Returns:
int The new index into the destination ConstantPoolTable of the cp_info located at position index in the source ConstantPoolTable
Throws:
DeepCopyException - Unable to perform the deep copy
java.lang.CloneNotSupportedException

deepCopy

public int deepCopy(int index,
                    boolean duplicate)
             throws DeepCopyException,
                    java.lang.CloneNotSupportedException
Copies the chain of cp_infos starting at index from the srcCpt to the dstCpt.

Specified by:
deepCopy in interface DeepCopier
Parameters:
index - The index in the source ConstantPoolTable from which the copy has to be started
Returns:
int The new index into the destination ConstantPoolTable of the cp_info located at position index in the source ConstantPoolTable
Throws:
DeepCopyException - Unable to perform the deep copy
java.lang.CloneNotSupportedException