Class TypedConstant

java.lang.Object
com.android.dx.rop.cst.Constant
com.android.dx.rop.cst.TypedConstant
All Implemented Interfaces:
TypeBearer, ToHuman, Comparable<Constant>
Direct Known Subclasses:
CstLiteralBits, CstMemberRef, CstMethodHandle, CstProtoRef, CstString, CstType

public abstract class TypedConstant extends Constant implements TypeBearer
Base class for constants which implement TypeBearer.
  • Constructor Details

    • TypedConstant

      public TypedConstant()
  • Method Details

    • getFrameType

      public final TypeBearer getFrameType()
      Gets the frame type corresponding to this type. This method returns this, except if Type.isIntlike() on the underlying type returns true but the underlying type is not in fact Type.INT, in which case this method returns an instance whose underlying type is INT. This implementation always returns this.
      Specified by:
      getFrameType in interface TypeBearer
      Returns:
      non-null; the frame type for this instance
    • getBasicType

      public final int getBasicType()
      Gets the basic type corresponding to this instance.
      Specified by:
      getBasicType in interface TypeBearer
      Returns:
      the basic type; one of the BT_* constants defined by Type
    • getBasicFrameType

      public final int getBasicFrameType()
      Gets the basic type corresponding to this instance's frame type. This is equivalent to getFrameType().getBasicType(), and is the same as calling getFrameType() unless this instance is an int-like type, in which case this method returns BT_INT.
      Specified by:
      getBasicFrameType in interface TypeBearer
      Returns:
      the basic frame type; one of the BT_* constants defined by Type
      See Also:
    • isConstant

      public final boolean isConstant()
      Returns whether this instance represents a constant value.
      Specified by:
      isConstant in interface TypeBearer
      Returns:
      true if this instance represents a constant value and false if not