FileDocCategorySizeDatePackage
CatchTable.javaAPI DocAndroid 1.5 API5309Wed May 06 22:41:02 BST 2009com.android.dx.dex.code

CatchTable

public final class CatchTable extends com.android.dx.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
non-null; empty instance
Constructors Summary
public CatchTable(int size)
Constructs an instance. All indices initially contain null.

param
size >= 0; the size of the table


                          
       
        super(size);
    
Methods Summary
public intcompareTo(com.android.dx.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.dx.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 NullPointerException.

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

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

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

        set0(n, entry);