|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjef.mixers.impl.simpleMixer.DnaSimpleMixer
public class DnaSimpleMixer
This class is in charge of performing a simple mix of two given Dna
instances.
This task is accomplished by generating a new Dna
instance consisiting of the
methods exposed by both the supplied Dnas. This simple Dna Mixer only appends methods exposed by
the second parameter to the ones exposed by the first one.
Field Summary | |
---|---|
protected Dna |
dnaX
|
protected Dna |
dnaY
|
Constructor Summary | |
---|---|
DnaSimpleMixer()
The default constructor. |
Method Summary | |
---|---|
protected int |
findThisClassType(Dna dna,
int thisIndex)
This method returns the index of the constant pool table entry containing the ConstantUTF8 structure representing the type of the class associated with the Dna
parameter. |
protected int |
findThisReference(ConstantPoolTable cpt)
|
Dna |
mix()
This method mixes the two Dna instances passed to the contructor and returns a
new one exposing a set of methods equals to the union of the ones exposed by both the
Dna instances above. |
protected ConstantPoolTable |
reorganizeIndexes(ConstantPoolTable cpt,
int offset)
This method reorganizes all the references within a constant pool table in a way that all of them get shifted by the given offset. |
protected void |
setAccessFlags(Dna dna,
Dna dnaX,
Dna dnaY)
This methodo sets the right access flags to the new generated class file. |
protected void |
setConstantPoolTable(Dna newDna,
ConstantPoolTable xCPT,
ConstantPoolTable yCPT)
newDna's constant pool table will be the union of xDna's and yDna's constant pool tables. |
void |
setDnas(Dna dnaX,
Dna dnaY)
This method sets the two Dna instances that will be used for generating the
new one. |
protected void |
setFields(Dna dna,
Dna xDna,
Dna yDna,
int thisEntry,
int fqnEntry)
The new dna instance will have, as fields, the union of xDna's and yDna's fields. |
protected void |
setMethods(Dna dna,
Dna dnaX,
Dna dnaY,
int thisEntry,
int fqnEntry)
The new dna instance will have, as methods, the union of xDna's and yDna's methods. |
protected void |
setMinorMajorNumber(Dna dna,
Dna dnaA,
Dna dnaB)
This method sets the values of the major and minor number for the new Dna
instance. |
protected void |
setSuperClass(Dna dna,
Dna dnaX)
|
protected void |
setThis(Dna dna,
Dna dnaX)
|
protected void |
updateConstantClassInfoRefs(ConstantPoolTable cpt,
java.lang.String fqClassName,
int newFqnIndx)
This method reorganizes the given constant pool table in a way that all the Constant Class Info structures pointing to a Constant UTF8 entry having a value equal to ,
will point to the constant pool table entry specified by the third input parameter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Dna dnaX
protected Dna dnaY
Constructor Detail |
---|
public DnaSimpleMixer() throws InstantiatorException
InstantiatorException
Method Detail |
---|
public void setDnas(Dna dnaX, Dna dnaY)
Dna
instances that will be used for generating the
new one.
setDnas
in interface DnaMixer
dnaX
- The first Dna
instance.dnaY
- The second Dna
instancepublic Dna mix() throws InstantiatorException, MixerException
Dna
instances passed to the contructor and returns a
new one exposing a set of methods equals to the union of the ones exposed by both the
Dna
instances above.
mix
in interface DnaMixer
Dna
instance exposing all the methods of the two Dna
instances passed to the constructor.
InstantiatorException
MixerException
protected void setMinorMajorNumber(Dna dna, Dna dnaA, Dna dnaB)
Dna
instance. Should xDna's maj. number be greater then yDna's maj. number, new maj. and minor
number will correspond to the xDna's ones.
protected void setConstantPoolTable(Dna newDna, ConstantPoolTable xCPT, ConstantPoolTable yCPT) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
protected void updateConstantClassInfoRefs(ConstantPoolTable cpt, java.lang.String fqClassName, int newFqnIndx) throws WrongReferenceInConstantPoolTableException
,
will point to the constant pool table entry specified by the third input parameter newFqnIndx
.
cpt
- The constant pool table to work withfqClassName
- The old fully qualified name we want to look for and replacenewFqnIndx
- The index of the new ConstantUTF8 entry in the given cpt, containing the new FQN
we want to point to
WrongReferenceInConstantPoolTableException
protected int findThisReference(ConstantPoolTable cpt)
protected int findThisClassType(Dna dna, int thisIndex) throws WrongReferenceInConstantPoolTableException
Dna
parameter.
WrongReferenceInConstantPoolTableException
protected ConstantPoolTable reorganizeIndexes(ConstantPoolTable cpt, int offset)
protected void setAccessFlags(Dna dna, Dna dnaX, Dna dnaY)
protected void setThis(Dna dna, Dna dnaX)
protected void setSuperClass(Dna dna, Dna dnaX)
protected void setFields(Dna dna, Dna xDna, Dna yDna, int thisEntry, int fqnEntry) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
protected void setMethods(Dna dna, Dna dnaX, Dna dnaY, int thisEntry, int fqnEntry) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |