FileDocCategorySizeDatePackage
CstMemberRef.javaAPI DocAndroid 5.1 API3388Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.rop.cst

CstMemberRef

public abstract class CstMemberRef extends TypedConstant
Constants of type {@code CONSTANT_*ref_info}.

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

param
definingClass {@code non-null;} the type of the defining class
param
nat {@code 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 {@code 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
{@code non-null;} the type of defining class

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

return
{@code 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() + '}";