FileDocCategorySizeDatePackage
ByteBlock.javaAPI DocAndroid 1.5 API4137Wed May 06 22:41:02 BST 2009com.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
>= 0; label for this block
private final int
start
>= 0; bytecode offset (inclusive) of the start of the block
private final int
end
> start; bytecode offset (exclusive) of the end of the block
private final com.android.dx.util.IntList
successors
non-null; list of successors that this block may branch to
private final ByteCatchList
catches
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 >= 0; target label for this block
param
start >= 0; bytecode offset (inclusive) of the start of the block
param
end > start; bytecode offset (exclusive) of the end of the block
param
successors non-null; list of successors that this block may branch to
param
catches 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
non-null; the catch list

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

return
> getStart(); the end offset

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

return
>= 0; the label

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

return
>= 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
non-null; the successor list

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

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