FileDocCategorySizeDatePackage
LocalVariableTableAttribute.javaAPI DocphoneME MR2 API (J2ME)3314Wed May 02 17:59:48 BST 2007components

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;