com.android.dx.dex.code
Class CatchHandlerList

java.lang.Object
  extended by com.android.dx.util.MutabilityControl
      extended by com.android.dx.util.FixedSizeList
          extended by com.android.dx.dex.code.CatchHandlerList
All Implemented Interfaces:
ToHuman, Comparable<CatchHandlerList>

public final class CatchHandlerList
extends FixedSizeList
implements Comparable<CatchHandlerList>

Ordered list of (exception type, handler address) entries.


Nested Class Summary
static class CatchHandlerList.Entry
          Entry in the list.
 
Field Summary
static CatchHandlerList EMPTY
          non-null; empty instance
 
Constructor Summary
CatchHandlerList(int size)
          Constructs an instance.
 
Method Summary
 boolean catchesAll()
          Returns whether or not this instance ends with a "catch-all" handler.
 int compareTo(CatchHandlerList other)
          
 CatchHandlerList.Entry get(int n)
          Gets the element at the given index.
 void set(int n, CatchHandlerList.Entry entry)
          Sets the entry at the given index.
 void set(int n, CstType exceptionType, int handler)
          Sets the entry at the given index.
 String toHuman()
          Return the "human" string form of this instance.
 String toHuman(String prefix, String header)
          Get the human form of this instance, prefixed on each line with the string.
 
Methods inherited from class com.android.dx.util.FixedSizeList
equals, get0, getOrNull0, hashCode, set0, shrinkToFit, size, toHuman, toString, toString
 
Methods inherited from class com.android.dx.util.MutabilityControl
isImmutable, isMutable, setImmutable, throwIfImmutable, throwIfMutable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final CatchHandlerList EMPTY
non-null; empty instance

Constructor Detail

CatchHandlerList

public CatchHandlerList(int size)
Constructs an instance. All indices initially contain null.

Parameters:
size - >= 0; the size of the list
Method Detail

get

public CatchHandlerList.Entry get(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.

Parameters:
n - >= 0, < size(); which index
Returns:
non-null; element at that index

toHuman

public String toHuman()
Return the "human" string form of this instance. This is generally less "debuggy" than toString(). This method will only work if every element of the list implements ToHuman.

Specified by:
toHuman in interface ToHuman
Overrides:
toHuman in class FixedSizeList
Returns:
non-null; the human string form

toHuman

public String toHuman(String prefix,
                      String header)
Get the human form of this instance, prefixed on each line with the string.

Parameters:
prefix - non-null; the prefix for every line
header - non-null; the header for the first line (after the first prefix)
Returns:
non-null; the human form

catchesAll

public boolean catchesAll()
Returns whether or not this instance ends with a "catch-all" handler.

Returns:
true if this instance ends with a "catch-all" handler or false if not

set

public void set(int n,
                CstType exceptionType,
                int handler)
Sets the entry at the given index.

Parameters:
n - >= 0, < size(); which index
exceptionType - non-null; type of exception handled
handler - >= 0; exception handler address

set

public void set(int n,
                CatchHandlerList.Entry entry)
Sets the entry at the given index.

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

compareTo

public int compareTo(CatchHandlerList other)

Specified by:
compareTo in interface Comparable<CatchHandlerList>


Copyright © 2013. All Rights Reserved.