FileDocCategorySizeDatePackage
AttConstantValue.javaAPI DocAndroid 5.1 API2628Thu Mar 12 22:18:30 GMT 2015com.android.dx.cf.attrib

AttConstantValue

public final class AttConstantValue extends BaseAttribute
Attribute class for standard {@code ConstantValue} attributes.

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

param
constantValue {@code non-null;} the constant value, which must be an instance of one of: {@code CstString}, {@code CstInteger}, {@code CstLong}, {@code CstFloat}, or {@code 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: {@code CstString}, {@code CstInteger}, {@code CstLong}, {@code CstFloat}, or {@code CstDouble}.

return
{@code non-null;} the constant value

        return constantValue;