FileDocCategorySizeDatePackage
CstInteger.javaAPI DocAndroid 5.1 API3367Thu Mar 12 22:18:30 GMT 2015com.android.dx.rop.cst

CstInteger

public final class CstInteger extends CstLiteral32
Constants of type {@code CONSTANT_Integer_info}.

Fields Summary
private static final CstInteger[]
cache
{@code non-null;} array of cached instances
public static final CstInteger
VALUE_M1
{@code non-null;} instance representing {@code -1}
public static final CstInteger
VALUE_0
{@code non-null;} instance representing {@code 0}
public static final CstInteger
VALUE_1
{@code non-null;} instance representing {@code 1}
public static final CstInteger
VALUE_2
{@code non-null;} instance representing {@code 2}
public static final CstInteger
VALUE_3
{@code non-null;} instance representing {@code 3}
public static final CstInteger
VALUE_4
{@code non-null;} instance representing {@code 4}
public static final CstInteger
VALUE_5
{@code non-null;} instance representing {@code 5}
Constructors Summary
private CstInteger(int value)
Constructs an instance. This constructor is private; use {@link #make}.

param
value the {@code int} value

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

        return Type.INT;
    
public intgetValue()
Gets the {@code int} value.

return
the value

        return getIntBits();
    
public static com.android.dx.rop.cst.CstIntegermake(int value)
Makes an instance for the given value. This may (but does not necessarily) return an already-allocated instance.

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


                                      
         
        /*
         * Note: No need to synchronize, since we don't make any sort
         * of guarantee about ==, and it's okay to overwrite existing
         * entries too.
         */
        int idx = (value & 0x7fffffff) % cache.length;
        CstInteger obj = cache[idx];

        if ((obj != null) && (obj.getValue() == value)) {
            return obj;
        }

        obj = new CstInteger(value);
        cache[idx] = obj;
        return obj;
    
public java.lang.StringtoHuman()
{@inheritDoc}

        return Integer.toString(getIntBits());
    
public java.lang.StringtoString()
{@inheritDoc}

        int value = getIntBits();
        return "int{0x" + Hex.u4(value) + " / " + value + '}";
    
public java.lang.StringtypeName()
{@inheritDoc}

        return "int";