com.vladium.jcd.cls.attribute
Interface IExceptionHandlerTable

All Superinterfaces:
java.lang.Cloneable, IClassFormatOutput
All Known Implementing Classes:
ExceptionHandlerTable

public interface IExceptionHandlerTable
extends java.lang.Cloneable, IClassFormatOutput

This table is a structure nested within the CodeAttribute_info. It is a table of Exception_info entries, each entry representing an exception handler range. The order of these entries is the order in which a JVM will check for a matching exception handler when the parent method throws an exception.

Author:
(C) 2001, Vlad Roubtsov

Method Summary
 int add(Exception_info exception)
          Adds a new Exception_info descriptor to this collection.
 java.lang.Object clone()
           
 Exception_info get(int offset)
          Returns Exception_info descriptor at a given offset.
 long length()
          Returns the total length of this table when converted to .class format [including 2 count bytes]
 Exception_info set(int offset, Exception_info exception)
          Replaces the Exception_info descriptor at a given offset.
 int size()
          Returns the number of descriptors in this collection [can be 0].
 
Methods inherited from interface com.vladium.jcd.compiler.IClassFormatOutput
writeInClassFormat
 

Method Detail

get

public Exception_info get(int offset)
Returns Exception_info descriptor at a given offset.

Parameters:
offset - exception offset [must be in [0, size()) range; input not checked]
Returns:
Exception_info descriptor [never null]
Throws:
java.lang.IndexOutOfBoundsException - if 'offset' is outside of valid range

size

public int size()
Returns the number of descriptors in this collection [can be 0].


length

public long length()
Returns the total length of this table when converted to .class format [including 2 count bytes]


clone

public java.lang.Object clone()

add

public int add(Exception_info exception)
Adds a new Exception_info descriptor to this collection. No duplicate checks are made. It is the responsibility of the caller to ensure that all data referenced in 'exception' will eventually be consistent with method's bytecode and the class's constant pool.

Parameters:
exception - new exception descriptor [may not be null]

set

public Exception_info set(int offset,
                          Exception_info exception)
Replaces the Exception_info descriptor at a given offset. No duplicate checks are made. No exception type compatibility checks are made. It is the responsibility of the caller to ensure that all data referenced in 'exception' will eventually be consistent with method's bytecode and the class's constant pool.

Parameters:
offset - exception offset [must be in [0, size()) range; input not checked]
exception - new exception descriptor [may not be null]
Returns:
previous exception descriptor at this offset [never null]
Throws:
java.lang.IndexOutOfBoundsException - if 'offset' is outside of valid range