FileDocCategorySizeDatePackage
ExceptionHandlerTable.javaAPI DocAndroid 1.5 API3333Wed May 06 22:41:16 BST 2009com.vladium.jcd.cls.attribute

ExceptionHandlerTable

public final class ExceptionHandlerTable extends Object implements IExceptionHandlerTable
author
(C) 2001, Vlad Roubtsov

Fields Summary
private List
m_exceptions
Constructors Summary
ExceptionHandlerTable(int capacity)

        m_exceptions = capacity < 0 ? new ArrayList () : new ArrayList (capacity);
    
Methods Summary
public intadd(Exception_info exception)

        final int newoffset = m_exceptions.size (); // use size() if class becomes non-final
        m_exceptions.add (exception);
        
        return newoffset;
    
public java.lang.Objectclone()
Performs a deep copy.

        try
        {
            final ExceptionHandlerTable _clone = (ExceptionHandlerTable) super.clone ();
            
            // deep clone:
            final int exceptions_count = m_exceptions.size (); // use size() if class becomes non-final
            _clone.m_exceptions = new ArrayList (exceptions_count);
            for (int e = 0; e < exceptions_count; ++ e)
            {
                _clone.m_exceptions.add (((Exception_info) m_exceptions.get (e)).clone ());
            }
            
            return _clone;
        }
        catch (CloneNotSupportedException e)
        {
            throw new InternalError (e.toString ());
        }        
    
public Exception_infoget(int offset)

        return (Exception_info) m_exceptions.get (offset);
    
public longlength()

        return 2 + (m_exceptions.size () << 3); // use size() if class becomes non-final
    
public Exception_infoset(int offset, Exception_info exception)

        return (Exception_info) m_exceptions.set (offset, exception);
    
public intsize()

        return m_exceptions.size ();
    
public voidwriteInClassFormat(com.vladium.jcd.lib.UDataOutputStream out)

        int exception_table_length = m_exceptions.size (); // use size() if class becomes non-final
        out.writeU2 (exception_table_length);
        
        for (int i = 0; i < exception_table_length; i++)
        {
            get (i).writeInClassFormat (out);
        }