Simply the generic-ity around Instruction, OffsetInstruction and InstructionMethodItem

This commit is contained in:
Ben Gruver
2012-09-25 20:18:42 -07:00
parent d317a0679d
commit 60bb8c675c
9 changed files with 20 additions and 20 deletions

View File

@ -34,7 +34,7 @@ import org.jf.dexlib.Code.Opcode;
import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
public class Instruction10t extends Instruction implements OffsetInstruction {
public class Instruction10t extends OffsetInstruction {
public static final InstructionFactory Factory = new Factory();
private int targetAddressOffset;

View File

@ -35,7 +35,7 @@ import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;
public class Instruction20t extends Instruction implements OffsetInstruction {
public class Instruction20t extends OffsetInstruction {
public static final InstructionFactory Factory = new Factory();
private int targetAddressOffset;

View File

@ -36,7 +36,7 @@ import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;
public class Instruction21t extends Instruction implements OffsetInstruction, SingleRegisterInstruction {
public class Instruction21t extends OffsetInstruction implements SingleRegisterInstruction {
public static final Instruction.InstructionFactory Factory = new Factory();
private byte regA;
private short targetAddressOffset;

View File

@ -36,7 +36,7 @@ import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;
public class Instruction22t extends Instruction implements OffsetInstruction, TwoRegisterInstruction {
public class Instruction22t extends OffsetInstruction implements TwoRegisterInstruction {
public static final Instruction.InstructionFactory Factory = new Factory();
private byte regA;
private byte regB;

View File

@ -35,7 +35,7 @@ import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;
public class Instruction30t extends Instruction implements OffsetInstruction {
public class Instruction30t extends OffsetInstruction {
public static final InstructionFactory Factory = new Factory();
private int targetAddressOffset;

View File

@ -36,7 +36,7 @@ import org.jf.dexlib.DexFile;
import org.jf.dexlib.Util.AnnotatedOutput;
import org.jf.dexlib.Util.NumberUtils;
public class Instruction31t extends Instruction implements OffsetInstruction, SingleRegisterInstruction {
public class Instruction31t extends OffsetInstruction implements SingleRegisterInstruction {
public static final Instruction.InstructionFactory Factory = new Factory();
private byte regA;
private int targetAddressOffset;

View File

@ -28,7 +28,11 @@
package org.jf.dexlib.Code;
public interface OffsetInstruction {
public int getTargetAddressOffset();
public void updateTargetAddressOffset(int targetAddressOffset);
public abstract class OffsetInstruction extends Instruction {
protected OffsetInstruction(Opcode opcode) {
super(opcode);
}
public abstract int getTargetAddressOffset();
public abstract void updateTargetAddressOffset(int targetAddressOffset);
}