FileDocCategorySizeDatePackage
CstMemberRef.javaAPI DocAndroid 1.5 API3350Wed May 06 22:41:02 BST 2009com.android.dx.rop.cst

CstMemberRef

public abstract class CstMemberRef extends TypedConstant
Constants of type CONSTANT_*ref_info.

Fields Summary
private final CstType
definingClass
non-null; the type of the defining class
private final CstNat
nat
non-null; the name-and-type
Constructors Summary
CstMemberRef(CstType definingClass, CstNat nat)
Constructs an instance.

param
definingClass non-null; the type of the defining class
param
nat non-null; the name-and-type

        if (definingClass == null) {
            throw new NullPointerException("definingClass == null");
        }

        if (nat == null) {
            throw new NullPointerException("nat == null");
        }

        this.definingClass = definingClass;
        this.nat = nat;
    
Methods Summary
protected intcompareTo0(Constant other)
{@inheritDoc}

Note: This implementation just compares the defining class and name, and it is up to subclasses to compare the rest after calling super.compareTo0().

        CstMemberRef otherMember = (CstMemberRef) other;
        int cmp = definingClass.compareTo(otherMember.definingClass);

        if (cmp != 0) {
            return cmp;
        }

        CstUtf8 thisName = nat.getName();
        CstUtf8 otherName = otherMember.nat.getName();

        return thisName.compareTo(otherName);
    
public final booleanequals(java.lang.Object other)
{@inheritDoc}

        if ((other == null) || (getClass() != other.getClass())) {
            return false;
        }

        CstMemberRef otherRef = (CstMemberRef) other;
        return definingClass.equals(otherRef.definingClass) && 
            nat.equals(otherRef.nat);
    
public final CstTypegetDefiningClass()
Gets the type of the defining class.

return
non-null; the type of defining class

        return definingClass;
    
public final CstNatgetNat()
Gets the defining name-and-type.

return
non-null; the name-and-type

        return nat;
    
public final inthashCode()
{@inheritDoc}

        return (definingClass.hashCode() * 31) ^ nat.hashCode();
    
public final booleanisCategory2()
{@inheritDoc}

        return false;
    
public final java.lang.StringtoHuman()
{@inheritDoc}

        return definingClass.toHuman() + '." + nat.toHuman();
    
public final java.lang.StringtoString()
{@inheritDoc}

        return typeName() + '{" + toHuman() + '}";