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

DeclaredExceptionTable

public final class DeclaredExceptionTable extends Object implements IDeclaredExceptionTable
author
(C) 2001, Vlad Roubtsov

Fields Summary
private com.vladium.util.IntVector
m_exceptions
Constructors Summary
DeclaredExceptionTable(int capacity)

         m_exceptions = capacity < 0 ? new IntVector () : new IntVector (capacity);
    
Methods Summary
public intadd(int exception_index)

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

        try
        {
            final DeclaredExceptionTable _clone = (DeclaredExceptionTable) super.clone ();
            
            // deep clone:
            _clone.m_exceptions = (IntVector) m_exceptions.clone ();
            
            return _clone;
        }
        catch (CloneNotSupportedException e)
        {
            throw new InternalError (e.toString ());
        }        
    
public intget(int offset)

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

        return (1 + m_exceptions.size ()) << 1; // use size() if class becomes non-final
    
public intset(int offset, int exception_index)

        return m_exceptions.set (offset, exception_index);
    
public intsize()

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

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