FileDocCategorySizeDatePackage
Zeroes.javaAPI DocAndroid 1.5 API1897Wed May 06 22:41:02 BST 2009com.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 null) value for the given type.

param
type non-null; the type in question
return
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());
            }
        }