FileDocCategorySizeDatePackage
LocalVariableTableAttribute.javaAPI DocJ2ME CLDC 1.12691Wed Feb 05 15:56:02 GMT 2003components

LocalVariableTableAttribute

public class LocalVariableTableAttribute extends Attribute

Fields Summary
public LocalVariableTableEntry[]
data
Constructors Summary
public LocalVariableTableAttribute(UnicodeConstant name, int l, LocalVariableTableEntry[] d)

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

    super.countConstantReferences( isRelocatable );
    for (int i = 0; i < data.length; i++) {
        data[i].name.incReference();
        data[i].sig.incReference();
    }
    
public voidexternalize(ConstantPool p)

    super.externalize( p );
     for (int i = 0; i < data.length; i++) {
        if (data[i].name != null) {
        data[i].name = (UnicodeConstant)p.add( data[i].name );
        }
        if (data[i].sig != null) {
        data[i].sig = (UnicodeConstant)p.add( data[i].sig );
        }
    }
    
public static AttributefinishReadAttribute(java.io.DataInput in, UnicodeConstant name, ConstantObject[] globals)

    int l;
    int n;
    LocalVariableTableEntry d[];

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

    UnicodeConstant name;

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

    int n = data.length;
    o.writeShort( n );
    for ( int i = 0; i < n; i++ ){
        data[i].write( o );
    }
    return 2+LocalVariableTableEntry.size*n;