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

Zeroes

public final class Zeroes extends Object
Utility for turning types into zeroes.

Fields Summary
Constructors Summary
private Zeroes()
This class is uninstantiable.

        // This space intentionally left blank.
    
Methods Summary
public static ConstantzeroFor(com.android.dx.rop.type.Type type)
Gets the "zero" (or {@code null}) value for the given type.

param
type {@code non-null;} the type in question
return
{@code non-null;} its "zero" value

        switch (type.getBasicType()) {
            case Type.BT_BOOLEAN: return CstBoolean.VALUE_FALSE;
            case Type.BT_BYTE:    return CstByte.VALUE_0;
            case Type.BT_CHAR:    return CstChar.VALUE_0;
            case Type.BT_DOUBLE:  return CstDouble.VALUE_0;
            case Type.BT_FLOAT:   return CstFloat.VALUE_0;
            case Type.BT_INT:     return CstInteger.VALUE_0;
            case Type.BT_LONG:    return CstLong.VALUE_0;
            case Type.BT_SHORT:   return CstShort.VALUE_0;
            case Type.BT_OBJECT:  return CstKnownNull.THE_ONE;
            default: {
                throw new UnsupportedOperationException("no zero for type: " +
                        type.toHuman());
            }
        }