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

CstNat

public final class CstNat extends Constant
Constants of type {@code CONSTANT_NameAndType_info}.

Fields Summary
public static final CstNat
PRIMITIVE_TYPE_NAT
{@code non-null;} the instance for name {@code TYPE} and descriptor {@code java.lang.Class}, which is useful when dealing with wrapped primitives
private final CstUtf8
name
{@code non-null;} the name
private final CstUtf8
descriptor
{@code non-null;} the descriptor (type)
Constructors Summary
public CstNat(CstUtf8 name, CstUtf8 descriptor)
Constructs an instance.

param
name {@code non-null;} the name
param
descriptor {@code non-null;} the descriptor


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

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

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

        CstNat otherNat = (CstNat) other;
        int cmp = name.compareTo(otherNat.name);

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

        return descriptor.compareTo(otherNat.descriptor);
    
public booleanequals(java.lang.Object other)
{@inheritDoc}

        if (!(other instanceof CstNat)) {
            return false;
        }

        CstNat otherNat = (CstNat) other;
        return name.equals(otherNat.name) &&
            descriptor.equals(otherNat.descriptor);
    
public CstUtf8getDescriptor()
Gets the descriptor.

return
{@code non-null;} the descriptor

        return descriptor;
    
public com.android.dexgen.rop.type.TypegetFieldType()
Gets the field type corresponding to this instance's descriptor. This method is only valid to call if the descriptor in fact describes a field (and not a method).

return
{@code non-null;} the field type

        return Type.intern(descriptor.getString());
    
public CstUtf8getName()
Gets the name.

return
{@code non-null;} the name

        return name;
    
public inthashCode()
{@inheritDoc}

        return (name.hashCode() * 31) ^ descriptor.hashCode();
    
public booleanisCategory2()
{@inheritDoc}

        return false;
    
public final booleanisClassInit()
Gets whether this instance has the name of a standard class initialization method. This is just a convenient shorthand for {@code getName().getString().equals("")}.

return
{@code true} iff this is a reference to an instance initialization method

        return name.getString().equals("<clinit>");
    
public final booleanisInstanceInit()
Gets whether this instance has the name of a standard instance initialization method. This is just a convenient shorthand for {@code getName().getString().equals("")}.

return
{@code true} iff this is a reference to an instance initialization method

        return name.getString().equals("<init>");
    
public java.lang.StringtoHuman()
Returns an unadorned but human-readable version of the name-and-type value.

return
{@code non-null;} the human form

        return name.toHuman() + ':" + descriptor.toHuman();
    
public java.lang.StringtoString()
{@inheritDoc}

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

        return "nat";