Package org.robolectric.res.android
Enum DataType
- java.lang.Object
-
- java.lang.Enum<DataType>
-
- org.robolectric.res.android.DataType
-
- All Implemented Interfaces:
Serializable,Comparable<DataType>
public enum DataType extends Enum<DataType>
Resource type codes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ATTRIBUTEdataholds an attribute resource identifier.DIMENSIONdataholds a complex number encoding a dimension value, such as "100in".DYNAMIC_ATTRIBUTEdataholds an attribute resource identifier, which needs to be resolved before it can be used like a TYPE_ATTRIBUTE.DYNAMIC_REFERENCEdataholds a dynamicResourceTableChunkentry reference.FLOATdataholds a single-precision floating point number.FRACTIONdataholds a complex number encoding a fraction of a container.INT_BOOLEANdatais either 0 (false) or 1 (true).INT_COLOR_ARGB4datais a raw integer value of the form #argb.INT_COLOR_ARGB8datais a raw integer value of the form #aarrggbb.INT_COLOR_RGB4datais a raw integer value of the form #rgb.INT_COLOR_RGB8datais a raw integer value of the form #rrggbb.INT_DECdatais a raw integer value of the form n..n.INT_HEXdatais a raw integer value of the form 0xn..n.NULLdatais either 0 (undefined) or 1 (empty).REFERENCEdataholds aResourceTableChunkentry reference.STRINGdataholds an index into the containing resource table's string pool.
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_FIRST_INTstatic intTYPE_LAST_INT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description bytecode()static DataTypefromCode(byte code)static DataTypefromCode(int code)static DataTypevalueOf(String name)Returns the enum constant of this type with the specified name.static DataType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NULL
public static final DataType NULL
datais either 0 (undefined) or 1 (empty).
-
REFERENCE
public static final DataType REFERENCE
dataholds aResourceTableChunkentry reference.
-
ATTRIBUTE
public static final DataType ATTRIBUTE
dataholds an attribute resource identifier.
-
STRING
public static final DataType STRING
dataholds an index into the containing resource table's string pool.
-
FLOAT
public static final DataType FLOAT
dataholds a single-precision floating point number.
-
DIMENSION
public static final DataType DIMENSION
dataholds a complex number encoding a dimension value, such as "100in".
-
FRACTION
public static final DataType FRACTION
dataholds a complex number encoding a fraction of a container.
-
DYNAMIC_REFERENCE
public static final DataType DYNAMIC_REFERENCE
dataholds a dynamicResourceTableChunkentry reference.
-
DYNAMIC_ATTRIBUTE
public static final DataType DYNAMIC_ATTRIBUTE
dataholds an attribute resource identifier, which needs to be resolved before it can be used like a TYPE_ATTRIBUTE.
-
INT_DEC
public static final DataType INT_DEC
datais a raw integer value of the form n..n.
-
INT_HEX
public static final DataType INT_HEX
datais a raw integer value of the form 0xn..n.
-
INT_BOOLEAN
public static final DataType INT_BOOLEAN
datais either 0 (false) or 1 (true).
-
INT_COLOR_ARGB8
public static final DataType INT_COLOR_ARGB8
datais a raw integer value of the form #aarrggbb.
-
INT_COLOR_RGB8
public static final DataType INT_COLOR_RGB8
datais a raw integer value of the form #rrggbb.
-
INT_COLOR_ARGB4
public static final DataType INT_COLOR_ARGB4
datais a raw integer value of the form #argb.
-
INT_COLOR_RGB4
public static final DataType INT_COLOR_RGB4
datais a raw integer value of the form #rgb.
-
-
Method Detail
-
values
public static DataType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataType c : DataType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
code
public byte code()
-
fromCode
public static DataType fromCode(int code)
-
fromCode
public static DataType fromCode(byte code)
-
-