FileDocCategorySizeDatePackage
AttConstantValue.javaAPI DocAndroid 1.5 API2653Wed May 06 22:41:02 BST 2009com.android.dx.cf.attrib

AttConstantValue

public final class AttConstantValue extends BaseAttribute
Attribute class for standard ConstantValue attributes.

Fields Summary
public static final String
ATTRIBUTE_NAME
non-null; attribute name for attributes of this type
private final com.android.dx.rop.cst.TypedConstant
constantValue
non-null; the constant value
Constructors Summary
public AttConstantValue(com.android.dx.rop.cst.TypedConstant constantValue)
Constructs an instance.

param
constantValue non-null; the constant value, which must be an instance of one of: CstString, CstInteger, CstLong, CstFloat, or CstDouble


                                 
       
        super(ATTRIBUTE_NAME);

        if (!((constantValue instanceof CstString) ||
               (constantValue instanceof CstInteger) ||
               (constantValue instanceof CstLong) ||
               (constantValue instanceof CstFloat) ||
               (constantValue instanceof CstDouble))) {
            if (constantValue == null) {
                throw new NullPointerException("constantValue == null");
            }
            throw new IllegalArgumentException("bad type for constantValue");
        }

        this.constantValue = constantValue;
    
Methods Summary
public intbyteLength()
{@inheritDoc}

        return 8;
    
public com.android.dx.rop.cst.TypedConstantgetConstantValue()
Gets the constant value of this instance. The returned value is an instance of one of: CstString, CstInteger, CstLong, CstFloat, or CstDouble.

return
non-null; the constant value

        return constantValue;