FileDocCategorySizeDatePackage
CstBoolean.javaAPI DocAndroid 5.1 API2787Thu Mar 12 22:18:30 GMT 2015com.android.dexgen.rop.cst

CstBoolean

public final class CstBoolean extends CstLiteral32
Constants of type {@code boolean}.

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

param
value the {@code boolean} value

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

        return Type.BOOLEAN;
    
public booleangetValue()
Gets the {@code boolean} value.

return
the value

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

param
value the {@code boolean} value
return
{@code non-null;} the appropriate instance


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

param
value must be either {@code 0} or {@code 1}
return
{@code 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";