Class Constant

java.lang.Object
com.android.dx.rop.cst.Constant
All Implemented Interfaces:
ToHuman, Comparable<Constant>
Direct Known Subclasses:
CstAnnotation, CstArray, CstCallSiteRef, CstInvokeDynamic, CstNat, TypedConstant

public abstract class Constant extends Object implements ToHuman, Comparable<Constant>
Base class for constants of all sorts.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    This compares in class-major and value-minor order.
    protected abstract int
    Compare the values of this and another instance, which are guaranteed to be of the same class.
    abstract boolean
    Returns true if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, or false if this instance is category-1.
    abstract String
    Returns the human name for the particular type of constant this instance is.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.android.dx.util.ToHuman

    toHuman
  • Constructor Details

    • Constant

      public Constant()
  • Method Details

    • isCategory2

      public abstract boolean isCategory2()
      Returns true if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, or false if this instance is category-1.
      Returns:
      true iff this instance is category-2
    • typeName

      public abstract String typeName()
      Returns the human name for the particular type of constant this instance is.
      Returns:
      non-null; the name
    • compareTo

      public final int compareTo(Constant other)
      This compares in class-major and value-minor order.
      Specified by:
      compareTo in interface Comparable<Constant>
    • compareTo0

      protected abstract 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.
      Parameters:
      other - non-null; the instance to compare to
      Returns:
      -1, 0, or 1, as usual for a comparison