Methods Summary |
---|
public static void | countConstantReferences(components.Attribute[] a, boolean isRelocatable)
if ( a == null ) return;
for ( int i = 0; i < a.length; i++ ){
a[i].countConstantReferences( isRelocatable );
}
|
public void | countConstantReferences(boolean isRelocatable)
//
// if we are producing relocatable output, then
// we will need our name in the string table.
// Else not.
//
if ( isRelocatable )
name.incReference();
|
public void | externalize(ConstantPool p)
if ( name != null ){
name = (UnicodeConstant)p.add( name );
}
|
public static void | externalizeAttributes(components.Attribute[] a, ConstantPool p)
int arryl = ( a == null ) ? 0 : a.length;
for ( int i = 0; i < arryl; i++ ){
a[i].externalize(p);
}
|
public int | length()
return 6+length; // believe length unchanged
|
public static int | length(components.Attribute[] a)
int l = 0;
int arryl = ( a == null ) ? 0 : a.length;
for ( int i = 0; i < arryl; i++ ){
l += a[i].length();
}
return l + 2;
|
public static components.Attribute[] | readAttributes(java.io.DataInput i, ConstantObject[] locals, ConstantObject[] globals, java.util.Hashtable typetable, boolean verbose)
int nattr = i.readUnsignedShort();
if ( verbose ){
System.out.println(Localizer.getString("attribute.reading_attributes", Integer.toString(nattr)));
}
if ( nattr == 0 ) return null;
Attribute a[] = new Attribute[nattr];
for ( int j = 0; j < nattr; j++ ){
UnicodeConstant name = (UnicodeConstant)globals[i.readUnsignedShort()];
String typename = name.string.intern();
AttributeFactory afact = (AttributeFactory)typetable.get( typename );
if ( afact == null )
afact = UninterpretedAttributeFactory.instance;
a[j] = afact.finishReadAttribute( i, name, locals, globals );
}
return a;
|
public void | write(java.io.DataOutput o)
o.writeShort( name.index );
o.writeInt( length );
int trueLength = writeData( o );
if ( length != trueLength ){
throw new DataFormatException(Localizer.getString("attribute.bad_attribute_length_for.dataformatexception", name ));
}
|
public static void | writeAttributes(components.Attribute[] a, java.io.DataOutput o, boolean verbose)
int nattr = ( a == null ) ? 0 : a.length;
if ( verbose ){
System.out.println(Localizer.getString("attribute.writing_attributes", Integer.toString(nattr)));
}
o.writeShort( nattr );
for ( int j = 0; j < nattr; j++ ){
if ( verbose ){
System.out.println(" "+a[j].name.string );
}
a[j].write( o );
}
|
protected abstract int | writeData(java.io.DataOutput o)
|