FileDocCategorySizeDatePackage
ExceptionsAttribute.javaAPI DocJ2ME CLDC 1.12136Wed Feb 05 15:56:02 GMT 2003components

ExceptionsAttribute

public class ExceptionsAttribute extends Attribute

Fields Summary
public ClassConstant[]
data
Constructors Summary
public ExceptionsAttribute(UnicodeConstant name, int l, ClassConstant[] d)

    super( name, l );
    data = d;
    
Methods Summary
public voidcountConstantReferences(boolean isRelocatable)

    super.countConstantReferences( isRelocatable );
    int n = data.length;
    for ( int i = 0; i < n; i++ ){
        data[i].incReference();
    }
    
public static AttributefinishReadAttribute(java.io.DataInput in, UnicodeConstant name, ConstantObject[] t)

    int l;
    int n;
    ClassConstant d[];

    l  = in.readInt();
    n  = in.readUnsignedShort();
    d = new ClassConstant[ n ];
    for ( int i = 0; i < n; i++ ){
        int index = in.readUnsignedShort();
        d[i] = (ClassConstant)t[ index ];
    }
    return new ExceptionsAttribute( name, l, d );
    
public static AttributereadAttribute(java.io.DataInput i, ConstantObject[] locals, ConstantObject[] globals)

    UnicodeConstant name;

    name = (UnicodeConstant)globals[i.readUnsignedShort()];
    return finishReadAttribute( i, name, locals );
    
protected intwriteData(java.io.DataOutput o)

    int n = data.length;
    o.writeShort( n );
    for ( int i = 0; i < n; i++ ){
        o.writeShort( data[i].index );
        // debug
        if ( data[i].index <= 0 ){
        System.err.println(Localizer.getString("exceptionsattribute.exceptions_table_references_negative_subscript", data[i]));
        }
        // end debug
    }
    return 2 + 2*n;