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

CstNat

public final class CstNat extends Constant
Constants of type CONSTANT_NameAndType_info.

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

param
name non-null; the name
param
descriptor 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
non-null; the descriptor

        return descriptor;
    
public com.android.dx.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
non-null; the field type

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

return
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 getName().getString().equals("<clinit>").

return
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 getName().getString().equals("<init>").

return
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
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";