com.android.dx.rop.cst
Class CstFieldRef

java.lang.Object
  extended by com.android.dx.rop.cst.Constant
      extended by com.android.dx.rop.cst.TypedConstant
          extended by com.android.dx.rop.cst.CstMemberRef
              extended by com.android.dx.rop.cst.CstFieldRef
All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>

public final class CstFieldRef
extends CstMemberRef

Constants of type CONSTANT_Fieldref_info.


Constructor Summary
CstFieldRef(CstType definingClass, CstNat nat)
          Constructs an instance.
 
Method Summary
protected  int compareTo0(Constant other)
          Compare the values of this and another instance, which are guaranteed to be of the same class.
static CstFieldRef forPrimitiveType(Type primitiveType)
          Returns an instance of this class that represents the static field which should hold the class corresponding to a given primitive type.
 Type getType()
          Returns the type of this field.
 String typeName()
          Returns the human name for the particular type of constant this instance is.
 
Methods inherited from class com.android.dx.rop.cst.CstMemberRef
equals, getDefiningClass, getNat, hashCode, isCategory2, toHuman, toString
 
Methods inherited from class com.android.dx.rop.cst.TypedConstant
getBasicFrameType, getBasicType, getFrameType, isConstant
 
Methods inherited from class com.android.dx.rop.cst.Constant
compareTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CstFieldRef

public CstFieldRef(CstType definingClass,
                   CstNat nat)
Constructs an instance.

Parameters:
definingClass - non-null; the type of the defining class
nat - non-null; the name-and-type
Method Detail

forPrimitiveType

public static CstFieldRef forPrimitiveType(Type primitiveType)
Returns an instance of this class that represents the static field which should hold the class corresponding to a given primitive type. For example, if given Type.INT, this method returns an instance corresponding to the field java.lang.Integer.TYPE.

Parameters:
primitiveType - non-null; the primitive type
Returns:
non-null; the corresponding static field

typeName

public String typeName()
Returns the human name for the particular type of constant this instance is.

Specified by:
typeName in class Constant
Returns:
non-null; the name

getType

public Type getType()
Returns the type of this field.

Returns:
non-null; the field's type

compareTo0

protected int compareTo0(Constant other)
Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.

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

Overrides:
compareTo0 in class CstMemberRef
Parameters:
other - non-null; the instance to compare to
Returns:
-1, 0, or 1, as usual for a comparison


Copyright © 2015. All rights reserved.