Methods Summary |
---|
public void | decReference()
references--;
name.decReference();
|
public boolean | equals(java.lang.Object o)
if (o instanceof ClassConstant) {
ClassConstant c = (ClassConstant) o;
return name.string.equals(c.name.string);
} else {
return false;
}
|
public void | externalize(ConstantPool p)
name = (UnicodeConstant)p.add( name );
|
public ClassInfo | find()
if ( !didLookup ){
theClass = ClassInfo.lookupClass( name.string );
didLookup = true;
}
return theClass; // which may be null
|
public void | forget()
didLookup = false;
theClass = null;
|
public int | hashCode()
return tag + name.hashCode();
|
public void | incReference()
references++;
name.incReference();
|
public boolean | isResolved() return find() != null;
|
public static components.ClassConstant | read(int tag, java.io.DataInput in)
return new ClassConstant( tag, in.readUnsignedShort() );
|
public void | resolve(ConstantObject[] table)
if (resolved) return;
name = (UnicodeConstant)table[nameIndex];
resolved = true;
|
public java.lang.String | toString()
if ( resolved )
return "Class: "+name.toString();
else
return "Class: ["+nameIndex+"]";
|
public void | write(java.io.DataOutput o)
o.writeByte( tag );
if ( ! resolved )
throw new DataFormatException("unresolved ClassConstant");
int x = name.index;
if ( x == 0 )
throw new DataFormatException("0 name index for "+name.string);
o.writeShort( x );
|