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

public final Class SwitchInsn

extends Insn
Class Inheritance
Imports
org.droidparts.dexmaker.dx.rop.type.StdTypeList, .Type, .TypeList, org.droidparts.dexmaker.dx.util.IntList

Instruction which contains switch cases.

Field Summary

Modifier and TypeField and Description
private final IntList
cases

non-null; list of switch cases

Constructor Summary

AccessConstructor and Description
public
SwitchInsn(Rop
non-null; the opcode
opcode
,
SourcePosition
non-null; source position
position
,
RegisterSpec
null-ok; spec for the result, if any
result
,
RegisterSpecList
non-null; specs for all the sources
sources
,
IntList
non-null; list of switch cases
cases
)

Constructs an instance.

Method Summary

Modifier and TypeMethod and Description
public void
accept(Insn.Visitor
non-null; the visitor to call on
visitor
)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.accept.

Calls the appropriate method on the given visitor, depending on the class of this instance.
public boolean
contentEquals(Insn b)

Overrides org.droidparts.dexmaker.dx.rop.code.Insn.contentEquals.

Compares Insn contents, since Insn.equals() is defined to be an identity compare.
public IntList

Returns:

non-null; the case list
getCases
()

Gets the list of switch cases.

public TypeList
getCatches()

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.getCatches.

Gets the list of possibly-caught exceptions.
public String
getInlineString()

Overrides org.droidparts.dexmaker.dx.rop.code.Insn.getInlineString.

Gets an "inline" string portion for toHuman(), if available.
public Insn
withAddedCatch(Type
non-null; type to append to the catch list
type
)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withAddedCatch.

Returns an instance that is just like this one, except that it has a catch list with the given item appended to the end.
public Insn
withNewRegisters(RegisterSpec
null-ok; new result register
result
,
RegisterSpecList
non-null; new sources registers
sources
)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withNewRegisters.

Returns an instance that is just like this one, except with new result and source registers.
public Insn
withRegisterOffset(int
the amount to offset register references by
delta
)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withRegisterOffset.

Returns an instance that is just like this one, except that all register references have been offset by the given delta.
Inherited from org.droidparts.dexmaker.dx.rop.code.Insn:
canThrowcopyequalsgetLocalAssignmentgetOpcodegetPositiongetResultgetSourceshashCodetoHumantoHumanWithInlinetoStringtoStringWithInlinewithSourceLiteral

Field Detail

casesback to summary
private final IntList cases

non-null; list of switch cases

Constructor Detail

SwitchInsnback to summary
public SwitchInsn(Rop opcode, SourcePosition position, RegisterSpec result, RegisterSpecList sources, IntList cases)

Constructs an instance.

Parameters
opcode:Rop

non-null; the opcode

position:SourcePosition

non-null; source position

result:RegisterSpec

null-ok; spec for the result, if any

sources:RegisterSpecList

non-null; specs for all the sources

cases:IntList

non-null; list of switch cases

Method Detail

acceptback to summary
public void accept(Insn.Visitor visitor)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.accept.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.accept.

Calls the appropriate method on the given visitor, depending on the class of this instance. Subclasses must override this.

Parameters
visitor:Insn.Visitor

non-null; the visitor to call on

Annotations
@Override
contentEqualsback to summary
public boolean contentEquals(Insn b)

Overrides org.droidparts.dexmaker.dx.rop.code.Insn.contentEquals.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.contentEquals.

Compares Insn contents, since Insn.equals() is defined to be an identity compare. Insn's are contentEquals() if they have the same opcode, registers, source position, and other metadata.

SwitchInsn always compares false. The current use for this method never encounters SwitchInsns

Returns:boolean

true in the case described above

Annotations
@Override
getCasesback to summary
public IntList getCases()

Gets the list of switch cases.

Returns:IntList

non-null; the case list

getCatchesback to summary
public TypeList getCatches()

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.getCatches.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.getCatches.

Gets the list of possibly-caught exceptions. This returns StdTypeList#EMPTY if this instruction has no handlers, which can be either if this instruction can't possibly throw or if it merely doesn't handle any of its possible exceptions. To determine whether this instruction can throw, use canThrow.

Returns:TypeList

non-null; the catches list

Annotations
@Override
getInlineStringback to summary
public String getInlineString()

Overrides org.droidparts.dexmaker.dx.rop.code.Insn.getInlineString.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.getInlineString.

Gets an "inline" string portion for toHuman(), if available. This is the portion that appears after the Rop opcode

Returns:String

null-ok; if non-null, the inline text for toHuman()

Annotations
@Override
withAddedCatchback to summary
public Insn withAddedCatch(Type type)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withAddedCatch.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.withAddedCatch.

Returns an instance that is just like this one, except that it has a catch list with the given item appended to the end. This method throws an exception if this instance can't possibly throw. To determine whether this instruction can throw, use canThrow.

Parameters
type:Type

non-null; type to append to the catch list

Returns:Insn

non-null; an appropriately-constructed instance

Annotations
@Override
withNewRegistersback to summary
public Insn withNewRegisters(RegisterSpec result, RegisterSpecList sources)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withNewRegisters.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.withNewRegisters.

Returns an instance that is just like this one, except with new result and source registers.

Parameters
result:RegisterSpec

null-ok; new result register

sources:RegisterSpecList

non-null; new sources registers

Returns:Insn

non-null; an appropriately-constructed instance

Annotations
@Override
withRegisterOffsetback to summary
public Insn withRegisterOffset(int delta)

Implements abstract org.droidparts.dexmaker.dx.rop.code.Insn.withRegisterOffset.

Doc from org.droidparts.dexmaker.dx.rop.code.Insn.withRegisterOffset.

Returns an instance that is just like this one, except that all register references have been offset by the given delta.

Parameters
delta:int

the amount to offset register references by

Returns:Insn

non-null; an appropriately-constructed instance

Annotations
@Override