Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Compil3r.Quad
Class ExceptionHandlerList  view ExceptionHandlerList download ExceptionHandlerList.java

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byCompil3r.Quad.ExceptionHandlerList
All Implemented Interfaces:
java.util.Collection, java.lang.Iterable, java.util.List, Util.Templates.List.ExceptionHandler

public class ExceptionHandlerList
extends java.util.AbstractList
implements Util.Templates.List.ExceptionHandler

Holds a list of exception handlers that protect a basic block. It includes a reference to a parent exception handler list, to handle nesting of exception handlers. These form a tree structure where each node has a pointer to its parent.

Version:
$Id: ExceptionHandlerList.java,v 1.8 2003/05/12 10:05:16 joewhaley Exp $

Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
static ExceptionHandlerList EMPTY
           
private  ExceptionHandler exception_handler
          The exception handler.
(package private)  ExceptionHandlerList parent
          The parent exception handler set.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
(package private) ExceptionHandlerList()
           
  ExceptionHandlerList(ExceptionHandler exception_handler)
          Creates new ExceptionHandlerList containing the given exception handler and no parent set.
  ExceptionHandlerList(ExceptionHandler exception_handler, ExceptionHandlerList parent)
          Creates new ExceptionHandlerList containing the given exception handler and parent set.
 
Method Summary
 Util.Templates.ListIterator.ExceptionHandler exceptionHandlerIterator()
          Return an iteration over the handlers in this set (and the handlers in parent sets).
 java.lang.Object get(int index)
          Get the element at a given index in this list.
static ExceptionHandlerList getEmptyList()
           
 ExceptionHandler getExceptionHandler(int index)
           
 ExceptionHandler getHandler()
          Return the handler in this set.
 ExceptionHandlerList getParent()
          Return the parent set of exception handlers, or null if this set doesn't have a parent.
 java.util.Iterator iterator()
          Obtain an Iterator over this list, whose sequence is the list order.
 java.util.ListIterator listIterator()
          Obtain a ListIterator over this list, starting at the beginning.
 Util.Templates.List.ExceptionHandler mayCatch(Clazz.jq_Class exType)
          Returns the list of exception handlers in this list that MAY catch the given exception type.
 ExceptionHandler mustCatch(Clazz.jq_Class exType)
          Returns the first exception handler in the list that MUST catch an exception of the given type, or null if there is no handler that must catch it.
 void setHandler(ExceptionHandler eh)
           
 void setParent(ExceptionHandlerList p)
           
 int size()
          Get the number of elements in this list.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, lastIndexOf, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, lastIndexOf, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Field Detail

exception_handler

private ExceptionHandler exception_handler
The exception handler.


parent

ExceptionHandlerList parent
The parent exception handler set.


EMPTY

public static final ExceptionHandlerList EMPTY
Constructor Detail

ExceptionHandlerList

ExceptionHandlerList()

ExceptionHandlerList

public ExceptionHandlerList(ExceptionHandler exception_handler)
Creates new ExceptionHandlerList containing the given exception handler and no parent set.


ExceptionHandlerList

public ExceptionHandlerList(ExceptionHandler exception_handler,
                            ExceptionHandlerList parent)
Creates new ExceptionHandlerList containing the given exception handler and parent set.

Method Detail

getHandler

public ExceptionHandler getHandler()
Return the handler in this set. Doesn't include parent handlers.


setHandler

public void setHandler(ExceptionHandler eh)

getParent

public ExceptionHandlerList getParent()
Return the parent set of exception handlers, or null if this set doesn't have a parent.


setParent

public void setParent(ExceptionHandlerList p)

mustCatch

public ExceptionHandler mustCatch(Clazz.jq_Class exType)
Returns the first exception handler in the list that MUST catch an exception of the given type, or null if there is no handler that must catch it.


mayCatch

public Util.Templates.List.ExceptionHandler mayCatch(Clazz.jq_Class exType)
Returns the list of exception handlers in this list that MAY catch the given exception type.


exceptionHandlerIterator

public Util.Templates.ListIterator.ExceptionHandler exceptionHandlerIterator()
Return an iteration over the handlers in this set (and the handlers in parent sets). Handlers are returned in the correct order (this set, followed by parent sets.)

Specified by:
exceptionHandlerIterator in interface Util.Templates.List.ExceptionHandler

iterator

public java.util.Iterator iterator()
Description copied from interface: java.util.List
Obtain an Iterator over this list, whose sequence is the list order.

Specified by:
iterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Description copied from interface: java.util.List
Obtain a ListIterator over this list, starting at the beginning.

Specified by:
listIterator in interface java.util.List

getExceptionHandler

public ExceptionHandler getExceptionHandler(int index)
Specified by:
getExceptionHandler in interface Util.Templates.List.ExceptionHandler

get

public java.lang.Object get(int index)
Description copied from interface: java.util.List
Get the element at a given index in this list.

Specified by:
get in interface java.util.List

size

public int size()
Description copied from interface: java.util.List
Get the number of elements in this list. If the list contains more than Integer.MAX_VALUE elements, return Integer.MAX_VALUE.

Specified by:
size in interface java.util.List

getEmptyList

public static ExceptionHandlerList getEmptyList()