FileDocCategorySizeDatePackage
Constant.javaAPI DocAndroid 5.1 API2090Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.cst

Constant

public abstract class Constant extends Object implements com.android.dx.util.ToHuman, Comparable
Base class for constants of all sorts.

Fields Summary
Constructors Summary
Methods Summary
public final intcompareTo(com.android.dx.rop.cst.Constant other)
{@inheritDoc} This compares in class-major and value-minor order.

        Class clazz = getClass();
        Class otherClazz = other.getClass();

        if (clazz != otherClazz) {
            return clazz.getName().compareTo(otherClazz.getName());
        }

        return compareTo0(other);
    
protected abstract intcompareTo0(com.android.dx.rop.cst.Constant other)
Compare the values of this and another instance, which are guaranteed to be of the same class. Subclasses must implement this.

param
other {@code non-null;} the instance to compare to
return
{@code -1}, {@code 0}, or {@code 1}, as usual for a comparison

public abstract booleanisCategory2()
Returns {@code true} if this instance is a category-2 constant, meaning it takes up two slots in the constant pool, or {@code false} if this instance is category-1.

return
{@code true} iff this instance is category-2

public abstract java.lang.StringtypeName()
Returns the human name for the particular type of constant this instance is.

return
{@code non-null;} the name