Methods Summary |
---|
public void | decReference()
references--;
sig.decReference();
clas.decReference();
|
public boolean | equals(java.lang.Object o)
if (o instanceof FMIrefConstant) {
FMIrefConstant f = (FMIrefConstant) o;
return tag == f.tag && clas.name.equals(f.clas.name) &&
sig.name.equals(f.sig.name) && sig.type.equals(f.sig.type);
} else {
return false;
}
|
public void | externalize(ConstantPool p)
sig = (NameAndTypeConstant)p.add( sig );
clas = (ClassConstant)p.dup( clas );
|
public ClassComponent | find(boolean isMethod)
if ( ! computedID ){
ID = Str2ID.sigHash.getID( sig.name, sig.type );
computedID = true;
}
ClassInfo c = ClassInfo.lookupClass( clas.name.string );
ClassComponent result = findInClass(c, isMethod);
if (result == null) {
result = findInInterfaces(c, isMethod);
}
return result;
|
private ClassComponent | findInClass(ClassInfo c, boolean isMethod)
while ( c != null ){
ClassMemberInfo t[] = isMethod ? (ClassMemberInfo[])c.methods : (ClassMemberInfo[])c.fields;
int l = t.length;
int thisID = this.getID();
for ( int i = 0; i < l ; i++ ){
if ( thisID == t[i].getID() )
return t[i];
}
c = c.superClassInfo;
}
return null;
|
private ClassComponent | findInInterfaces(ClassInfo c, boolean isMethod)
ClassConstant interfaces[] = c.interfaces;
ClassComponent result;
for (int i = 0; i < interfaces.length; i++) {
ClassInfo inf = ClassInfo.lookupClass( interfaces[i].name.string );
result = findInClass(inf, isMethod);
if (result != null) return result;
}
for (int i = 0; i < interfaces.length; i++) {
ClassInfo inf = ClassInfo.lookupClass( interfaces[i].name.string );
result = findInInterfaces(inf, isMethod);
if (result != null) return result;
}
return null;
|
public int | getID()
if ( ! computedID ){
ID = Str2ID.sigHash.getID( sig.name, sig.type );
computedID = true;
}
return ID;
|
public int | hashCode()
return tag + sig.hashCode() + clas.hashCode();
|
public void | incReference()
references++;
sig.incReference();
clas.incReference();
|
public boolean | isResolved() return find( tag!=Const.CONSTANT_FIELD ) != null;
|
public void | read(java.io.DataInput in)
classIndex = in.readUnsignedShort();
sigIndex = in.readUnsignedShort();
|
public void | resolve(ConstantObject[] table)
if (resolved) return;
try{ //DEBUG
sig = (NameAndTypeConstant)table[sigIndex];
clas = (ClassConstant)table[classIndex];
} catch( RuntimeException t ){//DEBUG
System.out.println(Localizer.getString("fmirefconstant.trouble_processing", this.toString()));
throw t;
}//end DEBUG
resolved = true;
|
public java.lang.String | toString()
String t = (tag==Const.CONSTANT_FIELD)?/*NOI18N*/"FieldRef: ":
(tag==Const.CONSTANT_METHOD)?/*NOI18N*/"MethodRef: ":
/*NOI18N*/"InterfaceRef: ";
if (resolved)
return t+clas.name.string+/*NOI18N*/" . "+sig.name.string+/*NOI18N*/" : "+sig.type.string;
else
return t+/*NOI18N*/"[ "+classIndex+/*NOI18N*/" . "+sigIndex+/*NOI18N*/" ]";
|
public void | write(java.io.DataOutput out)
out.writeByte( tag );
if ( resolved ){
out.writeShort( clas.index );
out.writeShort( sig.index );
} else {
throw new DataFormatException(Localizer.getString("fmirefconstant.unresolved_fmirefconstant.dataformatexception"));
//out.writeShort( classIndex );
//out.writeShort( sigIndex );
}
|