Methods Summary |
---|
public void | decReference()
references--;
name.decReference();
type.decReference();
|
public boolean | equals(java.lang.Object o)
if (o instanceof NameAndTypeConstant) {
NameAndTypeConstant n = (NameAndTypeConstant) o;
return name.string.equals(n.name.string) &&
type.string.equals(n.type.string);
} else {
return false;
}
|
public void | externalize(ConstantPool p)
name = (UnicodeConstant)p.add( name );
type = (UnicodeConstant)p.add( type );
|
public int | hashCode()
return tag + name.string.hashCode() + type.string.hashCode();
|
public void | incReference()
references++;
name.incReference();
type.incReference();
|
public boolean | isResolved() return true;
|
public static ConstantObject | read(int t, java.io.DataInput i)
return new NameAndTypeConstant( t, i.readUnsignedShort(), i.readUnsignedShort() );
|
public void | resolve(ConstantObject[] table)
if ( resolved ) return;
name = (UnicodeConstant)table[nameIndex];
type = (UnicodeConstant)table[typeIndex];
resolved = true;
|
public java.lang.String | toString()
if ( resolved ){
return "NameAndType: "+name.string+" : "+type.string;
}else{
return "NameAndType[ "+nameIndex+" : "+typeIndex+" ]";
}
|
public void | write(java.io.DataOutput o)
o.writeByte( tag );
if ( resolved ){
o.writeShort( name.index );
o.writeShort( type.index );
} else {
throw new DataFormatException("unresolved NameAndTypeConstant");
//o.writeShort( nameIndex );
//o.writeShort( typeIndex );
}
|