Top Description Constructors Methods
org.droidparts.dexmaker.dx.rop.cst

public abstract Class Constant

extends Object
implements ToHuman, Comparable<Constant>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, org.droidparts.dexmaker.dx.util.ToHuman
Known Direct Subclasses
org.droidparts.dexmaker.dx.rop.cst.CstAnnotation, org.droidparts.dexmaker.dx.rop.cst.CstArray, org.droidparts.dexmaker.dx.rop.cst.CstNat, org.droidparts.dexmaker.dx.rop.cst.TypedConstant
Imports
org.droidparts.dexmaker.dx.util.ToHuman

Base class for constants of all sorts.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final int
compareTo(Constant
the object to be compared.
other
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
protected abstract int

Returns:

-1, 0, or 1, as usual for a comparison
compareTo0
(Constant
non-null; the instance to compare to
other
)

Compare the values of this and another instance, which are guaranteed to be of the same class.

public abstract boolean

Returns:

true iff this instance is category-2
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.

public abstract String

Returns:

non-null; the name
typeName
()

Returns the human name for the particular type of constant this instance is.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Constantback to summary
public Constant()

Method Detail

compareToback to summary
public final int compareTo(Constant other)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z. This compares in class-major and value-minor order.

Parameters
other:Constant

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

compareTo0back to summary
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:Constant

non-null; the instance to compare to

Returns:int

-1, 0, or 1, as usual for a comparison

isCategory2back to summary
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:boolean

true iff this instance is category-2

typeNameback to summary
public abstract String typeName()

Returns the human name for the particular type of constant this instance is.

Returns:String

non-null; the name