FileDocCategorySizeDatePackage
Constant.javaAPI DocAndroid 1.5 API2106Wed May 06 22:41:02 BST 2009com.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 non-null; the instance to compare to
return
-1, 0, or 1, as usual for a comparison

public abstract booleanisCategory2()
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.

return
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
non-null; the name