FileDocCategorySizeDatePackage
CatchTable.javaAPI DocAndroid 5.1 API5361Thu Mar 12 22:18:28 GMT 2015com.android.dexgen.dex.code

CatchTable

public final class CatchTable extends com.android.dexgen.util.FixedSizeList implements Comparable
Table of catch entries. Each entry includes a range of code addresses for which it is valid and an associated {@link CatchHandlerList}.

Fields Summary
public static final CatchTable
EMPTY
{@code non-null;} empty instance
Constructors Summary
public CatchTable(int size)
Constructs an instance. All indices initially contain {@code null}.

param
size {@code >= 0;} the size of the table


                            
       
        super(size);
    
Methods Summary
public intcompareTo(com.android.dexgen.dex.code.CatchTable other)
{@inheritDoc}

        if (this == other) {
            // Easy out.
            return 0;
        }

        int thisSize = size();
        int otherSize = other.size();
        int checkSize = Math.min(thisSize, otherSize);

        for (int i = 0; i < checkSize; i++) {
            Entry thisEntry = get(i);
            Entry otherEntry = other.get(i);
            int compare = thisEntry.compareTo(otherEntry);
            if (compare != 0) {
                return compare;
            }
        }

        if (thisSize < otherSize) {
            return -1;
        } else if (thisSize > otherSize) {
            return 1;
        }

        return 0;
    
public com.android.dexgen.dex.code.CatchTable$Entryget(int n)
Gets the element at the given index. It is an error to call this with the index for an element which was never set; if you do that, this will throw {@code NullPointerException}.

param
n {@code >= 0, < size();} which index
return
{@code non-null;} element at that index

        return (Entry) get0(n);
    
public voidset(int n, com.android.dexgen.dex.code.CatchTable$Entry entry)
Sets the entry at the given index.

param
n {@code >= 0, < size();} which index
param
entry {@code non-null;} the entry to set at {@code n}

        set0(n, entry);