FileDocCategorySizeDatePackage
CstBoolean.javaAPI DocAndroid 1.5 API2796Wed May 06 22:41:02 BST 2009com.android.dx.rop.cst

CstBoolean

public final class CstBoolean extends CstLiteral32
Constants of type boolean.

Fields Summary
public static final CstBoolean
VALUE_FALSE
non-null; instance representing false
public static final CstBoolean
VALUE_TRUE
non-null; instance representing true
Constructors Summary
private CstBoolean(boolean value)
Constructs an instance. This constructor is private; use {@link #make}.

param
value the boolean value

        super(value ? 1 : 0);
    
Methods Summary
public com.android.dx.rop.type.TypegetType()
{@inheritDoc}

        return Type.BOOLEAN;
    
public booleangetValue()
Gets the boolean value.

return
the value

        return (getIntBits() == 0) ? false : true;
    
public static com.android.dx.rop.cst.CstBooleanmake(boolean value)
Makes an instance for the given value. This will return an already-allocated instance.

param
value the boolean value
return
non-null; the appropriate instance


                                 
         
        return value ? VALUE_TRUE : VALUE_FALSE;
    
public static com.android.dx.rop.cst.CstBooleanmake(int value)
Makes an instance for the given int value. This will return an already-allocated instance.

param
value must be either 0 or 1
return
non-null; the appropriate instance

        if (value == 0) {
            return VALUE_FALSE;
        } else if (value == 1) {
            return VALUE_TRUE;
        } else {
            throw new IllegalArgumentException("bogus value: " + value);
        }
    
public java.lang.StringtoHuman()
{@inheritDoc}

        return getValue() ? "true" : "false";
    
public java.lang.StringtoString()
{@inheritDoc}

        return getValue() ? "boolean{true}" : "boolean{false}";
    
public java.lang.StringtypeName()
{@inheritDoc}

        return "boolean";