enum PrimitiveType extends java.lang.Enum<PrimitiveType>
Enum Constant and Description |
---|
BOOLEAN
boolean.class
|
BYTE
byte.class
|
CHAR
char.class
|
DOUBLE
double.class
|
FLOAT
float.class
|
INT
int.class
|
LONG
long.class
|
SHORT
short.class
|
Modifier and Type | Field and Description |
---|---|
private int |
size |
private java.lang.Class<?> |
type |
Modifier and Type | Method and Description |
---|---|
static PrimitiveType |
forType(java.lang.Class<?> type)
Finds the matching PrimitiveType for a type
|
static long |
getArraySize()
The size on an array
|
static int |
getReferenceSize()
The size of a pointer
|
int |
getSize()
Returns the size in memory this type occupies
|
java.lang.Class<?> |
getType()
The representing type
|
static PrimitiveType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PrimitiveType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PrimitiveType BOOLEAN
public static final PrimitiveType BYTE
public static final PrimitiveType CHAR
public static final PrimitiveType SHORT
public static final PrimitiveType INT
public static final PrimitiveType FLOAT
public static final PrimitiveType DOUBLE
public static final PrimitiveType LONG
public static PrimitiveType[] values()
for (PrimitiveType c : PrimitiveType.values()) System.out.println(c);
public static PrimitiveType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getSize()
public java.lang.Class<?> getType()
public static int getReferenceSize()
public static long getArraySize()
public static PrimitiveType forType(java.lang.Class<?> type)
type
- the type to find the PrimitiveType for