FileDocCategorySizeDatePackage
ByteBlock.javaAPI DocAndroid 5.1 API4222Thu Mar 12 22:18:30 GMT 2015com.android.dx.cf.code

ByteBlock

public final class ByteBlock extends Object implements com.android.dx.util.LabeledItem
Representation of a basic block in a bytecode array.

Fields Summary
private final int
label
{@code >= 0;} label for this block
private final int
start
{@code >= 0;} bytecode offset (inclusive) of the start of the block
private final int
end
{@code > start;} bytecode offset (exclusive) of the end of the block
private final com.android.dx.util.IntList
successors
{@code non-null;} list of successors that this block may branch to
private final ByteCatchList
catches
{@code non-null;} list of exceptions caught and their handler targets
Constructors Summary
public ByteBlock(int label, int start, int end, com.android.dx.util.IntList successors, ByteCatchList catches)
Constructs an instance.

param
label {@code >= 0;} target label for this block
param
start {@code >= 0;} bytecode offset (inclusive) of the start of the block
param
end {@code > start;} bytecode offset (exclusive) of the end of the block
param
successors {@code non-null;} list of successors that this block may branch to
param
catches {@code non-null;} list of exceptions caught and their handler targets

        if (label < 0) {
            throw new IllegalArgumentException("label < 0");
        }

        if (start < 0) {
            throw new IllegalArgumentException("start < 0");
        }

        if (end <= start) {
            throw new IllegalArgumentException("end <= start");
        }

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

        int sz = successors.size();
        for (int i = 0; i < sz; i++) {
            if (successors.get(i) < 0) {
                throw new IllegalArgumentException("successors[" + i +
                                                   "] == " +
                                                   successors.get(i));
            }
        }

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

        this.label = label;
        this.start = start;
        this.end = end;
        this.successors = successors;
        this.catches = catches;
    
Methods Summary
public ByteCatchListgetCatches()
Gets the list of exceptions caught and their handler targets.

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

        return catches;
    
public intgetEnd()
Gets the bytecode offset (exclusive) of the end of this block.

return
{@code > getStart();} the end offset

        return end;
    
public intgetLabel()
Gets the label of this block.

return
{@code >= 0;} the label

        return label;
    
public intgetStart()
Gets the bytecode offset (inclusive) of the start of this block.

return
{@code >= 0;} the start offset

        return start;
    
public com.android.dx.util.IntListgetSuccessors()
Gets the list of successors that this block may branch to non-exceptionally.

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

        return successors;
    
public java.lang.StringtoString()
{@inheritDoc}

        return '{" + Hex.u2(label) + ": " + Hex.u2(start) + ".." +
            Hex.u2(end) + '}";