FileDocCategorySizeDatePackage
SwitchInsn.javaAPI DocAndroid 5.1 API3392Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.code

SwitchInsn

public final class SwitchInsn extends Insn
Instruction which contains switch cases.

Fields Summary
private final com.android.dx.util.IntList
cases
{@code non-null;} list of switch cases
Constructors Summary
public SwitchInsn(Rop opcode, SourcePosition position, RegisterSpec result, RegisterSpecList sources, com.android.dx.util.IntList cases)
Constructs an instance.

param
opcode {@code non-null;} the opcode
param
position {@code non-null;} source position
param
result {@code null-ok;} spec for the result, if any
param
sources {@code non-null;} specs for all the sources
param
cases {@code non-null;} list of switch cases

        super(opcode, position, result, sources);

        if (opcode.getBranchingness() != Rop.BRANCH_SWITCH) {
            throw new IllegalArgumentException("bogus branchingness");
        }

        if (cases == null) {
            throw new NullPointerException("cases == null");
        }

        this.cases = cases;
    
Methods Summary
public voidaccept(Visitor visitor)
{@inheritDoc}

        visitor.visitSwitchInsn(this);
    
public booleancontentEquals(Insn b)
{@inheritDoc}

SwitchInsn always compares false. The current use for this method never encounters {@code SwitchInsn}s

        return false;
    
public com.android.dx.util.IntListgetCases()
Gets the list of switch cases.

return
{@code non-null;} the case list

        return cases;
    
public com.android.dx.rop.type.TypeListgetCatches()
{@inheritDoc}

        return StdTypeList.EMPTY;
    
public java.lang.StringgetInlineString()
{@inheritDoc}

        return cases.toString();
    
public InsnwithAddedCatch(com.android.dx.rop.type.Type type)
{@inheritDoc}

        throw new UnsupportedOperationException("unsupported");
    
public InsnwithNewRegisters(RegisterSpec result, RegisterSpecList sources)
{@inheritDoc}


        return new SwitchInsn(getOpcode(), getPosition(),
                              result,
                              sources,
                              cases);
    
public InsnwithRegisterOffset(int delta)
{@inheritDoc}

        return new SwitchInsn(getOpcode(), getPosition(),
                              getResult().withOffset(delta),
                              getSources().withOffset(delta),
                              cases);