Package com.android.dx.rop.cst
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
Base class for constants of all sorts.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
This compares in class-major and value-minor order.protected abstract int
compareTo0
(Constant other) Compare the values of this and another instance, which are guaranteed to be of the same class.abstract boolean
Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.abstract String
typeName()
Returns the human name for the particular type of constant this instance is.
-
Constructor Details
-
Constant
public Constant()
-
-
Method Details
-
isCategory2
public abstract boolean isCategory2()Returnstrue
if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, orfalse
if this instance is category-1.- Returns:
true
iff this instance is category-2
-
typeName
Returns the human name for the particular type of constant this instance is.- Returns:
non-null;
the name
-
compareTo
This compares in class-major and value-minor order.- Specified by:
compareTo
in interfaceComparable<Constant>
-
compareTo0
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
, or1
, as usual for a comparison
-