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

ClassMemberInfo

public abstract class ClassMemberInfo extends ClassComponent

Fields Summary
public int
access
public int
nameIndex
public int
typeIndex
public UnicodeConstant
name
public UnicodeConstant
type
public ClassInfo
parent
private int
ID
private boolean
computedID
public int
index
public int
flags
public static final int
INCLUDE
Constructors Summary
public ClassMemberInfo(int n, int t, int a, ClassInfo p)

 // a flag value.

              
	nameIndex = n;
	typeIndex = t;
	access    = a;
	parent    = p;
	flags	  = INCLUDE; // by default, we want everything.
    
Methods Summary
public voidcountConstantReferences()

	if ( name != null ) name.incReference();
	if ( type != null ) type.incReference();
    
public voidexternalize(ConstantPool p)

	name = (UnicodeConstant)p.add( name );
	type = (UnicodeConstant)p.add( type );
    
public intgetID()

	if ( ! computedID ){
	    ID       = Str2ID.sigHash.getID( name, type );
	    computedID = true;
	}
	return ID;
    
public booleanisPrivateMember()

	return ( (access & Const.ACC_PRIVATE) != 0 );
    
public booleanisStaticMember()

	return ( (access & Const.ACC_STATIC) != 0 );
    
public booleanmayBeRenamed()
Returns true if this is a member that can be safely renamed: e.g., it's a private or package protected method, and it's not native.

        if ((access & (Const.ACC_PUBLIC | Const.ACC_PROTECTED)) == 0) {
            /* it's a private or package protected method */
            if ((access & Const.ACC_NATIVE) == 0) {
                return true;
            }
        }
        return false;
    
public java.lang.StringqualifiedName()

	if ( resolved ){
	    return name.string+":"+type.string;
	}else{
	    return Util.accessToString(access)+" "+parent.className+" [ "+nameIndex+" : "+typeIndex+" ]";
	}
    
public voidresolve(ConstantObject[] table)

	if ( resolved ) return;
	name     = (UnicodeConstant)table[nameIndex];
	type     = (UnicodeConstant)table[typeIndex];
	resolved = true;
    
public java.lang.StringtoString()

	if ( resolved ){
	    return Util.accessToString(access)+" "+name.string+" : "+type.string;
	} else {
	    return Util.accessToString(access)+" [ "+nameIndex+" : "+typeIndex+" ]";
	}