Top Description Fields Constructors Methods
org.droidparts.dexmaker.dx.dex.code

public final Class CstInsn

extends FixedSizeInsn
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.code.RegisterSpecList, .SourcePosition, org.droidparts.dexmaker.dx.rop.cst.Constant

Instruction which has a single constant argument in addition to all the normal instruction information.

Field Summary

Modifier and TypeField and Description
private int
classIndex

>= -1; the constant pool index for the class reference in constant if any, or -1 if not yet set

private final Constant
constant

non-null; the constant argument for this instruction

private int
index

>= -1; the constant pool index for constant, or -1 if not yet set

Constructor Summary

AccessConstructor and Description
public
CstInsn(Dop
the opcode; one of the constants from Dops
opcode
,
SourcePosition
non-null; source position
position
,
RegisterSpecList
non-null; register list, including a result register if appropriate (that is, registers may be either ins or outs)
registers
,
Constant
non-null; constant argument
constant
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
protected String
argString()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Gets the string form for any arguments to this instance.
public int

Returns:

>= 0; the constant's class's constant pool index
getClassIndex
()

Gets the constant's class index.

public Constant

Returns:

non-null; the constant argument
getConstant
()

Gets the constant argument.

public int

Returns:

>= 0; the constant pool index
getIndex
()

Gets the constant's index.

public boolean

Returns:

true iff the index has been set
hasClassIndex
()

Returns whether the constant's class index has been set for this instance.

public boolean

Returns:

true iff the index has been set
hasIndex
()

Returns whether the constant's index has been set for this instance.

public void
setClassIndex(int
>= 0; the constant's class's constant pool index
index
)

Sets the constant's class index.

public void
setIndex(int
>= 0; the constant pool index
index
)

Sets the constant's index.

public DalvInsn
withOpcode(Dop
non-null; the new opcode
opcode
)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withOpcode.

Returns an instance that is just like this one, except that its opcode is replaced by the one given, and its address is reset.
public DalvInsn
withRegisters(RegisterSpecList
non-null; new register list
registers
)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.
Inherited from org.droidparts.dexmaker.dx.dex.code.FixedSizeInsn:
codeSizelistingString0withRegisterOffsetwriteTo

Field Detail

classIndexback to summary
private int classIndex

>= -1; the constant pool index for the class reference in constant if any, or -1 if not yet set

constantback to summary
private final Constant constant

non-null; the constant argument for this instruction

indexback to summary
private int index

>= -1; the constant pool index for constant, or -1 if not yet set

Constructor Detail

CstInsnback to summary
public CstInsn(Dop opcode, SourcePosition position, RegisterSpecList registers, Constant constant)

Constructs an instance. The output address of this instance is initially unknown (-1) as is the constant pool index.

Parameters
opcode:Dop

the opcode; one of the constants from Dops

position:SourcePosition

non-null; source position

registers:RegisterSpecList

non-null; register list, including a result register if appropriate (that is, registers may be either ins or outs)

constant:Constant

non-null; constant argument

Method Detail

argStringback to summary
protected String argString()

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.argString.

Gets the string form for any arguments to this instance. Subclasses must override this.

Returns:String

null-ok; the string version of any arguments or null if there are none

Annotations
@Override
getClassIndexback to summary
public int getClassIndex()

Gets the constant's class index. It is only valid to call this after setClassIndex has been called.

Returns:int

>= 0; the constant's class's constant pool index

getConstantback to summary
public Constant getConstant()

Gets the constant argument.

Returns:Constant

non-null; the constant argument

getIndexback to summary
public int getIndex()

Gets the constant's index. It is only valid to call this after setIndex has been called.

Returns:int

>= 0; the constant pool index

hasClassIndexback to summary
public boolean hasClassIndex()

Returns whether the constant's class index has been set for this instance.

Returns:boolean

true iff the index has been set

See Also
setClassIndex
hasIndexback to summary
public boolean hasIndex()

Returns whether the constant's index has been set for this instance.

Returns:boolean

true iff the index has been set

See Also
setIndex
setClassIndexback to summary
public void setClassIndex(int index)

Sets the constant's class index. This is the constant pool index for the class referred to by this instance's constant. Only reference constants have a class, so it is only on instances with reference constants that this method should ever be called. It is only valid to call this method once per instance.

Parameters
index:int

>= 0; the constant's class's constant pool index

setIndexback to summary
public void setIndex(int index)

Sets the constant's index. It is only valid to call this method once per instance.

Parameters
index:int

>= 0; the constant pool index

withOpcodeback to summary
public DalvInsn withOpcode(Dop opcode)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withOpcode.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.withOpcode.

Returns an instance that is just like this one, except that its opcode is replaced by the one given, and its address is reset.

Parameters
opcode:Dop

non-null; the new opcode

Returns:DalvInsn

non-null; an appropriately-constructed instance

Annotations
@Override
withRegistersback to summary
public DalvInsn withRegisters(RegisterSpecList registers)

Implements abstract org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Doc from org.droidparts.dexmaker.dx.dex.code.DalvInsn.withRegisters.

Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.

Parameters
registers:RegisterSpecList

non-null; new register list

Returns:DalvInsn

non-null; an appropriately-constructed instance

Annotations
@Override