|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.acorn.util.converter.Types
public abstract class Types
Converts between primitive types and lang classes.
| Field Summary | |
|---|---|
static String |
BOOLEAN_CLASS_NAME
Boolean class name. |
static String |
BOOLEAN_TYPE
boolean type. |
static String |
BYTE_CLASS_NAME
Byte class name. |
static String |
BYTE_TYPE
byte type. |
static String |
CHAR_TYPE
char type. |
static String |
CHARACTER_CLASS_NAME
Character class name. |
static String |
DOUBLE_CLASS_NAME
Double class name. |
static String |
DOUBLE_TYPE
double type. |
static String |
FLOAT_CLASS_NAME
Float class name. |
static String |
FLOAT_TYPE
float type. |
static String |
INT_TYPE
int type. |
static String |
INTEGER_CLASS_NAME
Integer class name. |
static String |
LONG_CLASS_NAME
Long class name. |
static String |
LONG_TYPE
long type. |
static Integer |
MINUS
Minus. |
static Double |
NAN
NaN. |
static String |
NULL_STRING
The string representation of null. |
static String |
OBJECT_CLASS_NAME
Object class name. |
static Integer |
PLUS
Plus. |
static String |
SHORT_CLASS_NAME
Short class name. |
static String |
SHORT_TYPE
short type. |
static String |
STRING_CLASS_NAME
String class name. |
static Integer |
ZERO
Zero. |
| Constructor Summary | |
|---|---|
Types()
|
|
| Method Summary | |
|---|---|
static ClassLoader |
getClassLoader()
Gets a class loader. |
static boolean |
isArrayType(String className)
Checks whether the specified class type is an array. |
static boolean |
isCharSequenceType(String className,
boolean arrayp)
Checks whether the specified class type is a char sequence, i.e. |
static boolean |
isNaN(Number number)
Checks whether the specified number is a NaN. |
static boolean |
isNumericType(String className,
boolean arrayp)
Checks whether the specified class type is numeric, i.e. |
static boolean |
isPrimitiveType(String className)
Checks whether the specified class type is primitive. |
static boolean |
isStringType(String className,
boolean arrayp)
Checks whether the specified class type is a string. |
static boolean |
toBoolean(String str)
Converts a string to a boolean. |
static byte |
toByte(String str)
Converts a string to a byte. |
static String |
toComponentType(String className)
Converts the specified array type to the corresponding component type. |
static int |
toInt(String str)
Converts a string to an int. |
static long |
toLong(String str)
Converts a string to a long. |
static Number |
toNumber(String str,
String type)
Converts a string to a number. |
static Class |
toObjectClass(Class type)
Converts a primitive type to its corresponding object class. |
static String |
toObjectType(String primitive)
Converts a primitive type to the corresponding object type. |
static String |
toPlainType(Class clazz)
Converts a class to its plain non-qualified component type. |
static String |
toPlainType(String className)
Converts a class name to its plain non-qualified component type. |
static String |
toPrimitiveArrayType(String className)
Converts an object type to the corresponding primitive array type. |
static Class |
toPrimitiveClass(Class clazz)
Converts a class to its corresponding primitive type. |
static Class |
toPrimitiveClass(String className)
Converts a named class to its corresponding primitive type. |
static String |
toPrimitiveType(String className)
Converts an object type to the corresponding primitive type. |
static short |
toShort(String str)
Converts a string to a short. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NULL_STRING
public static final Double NAN
public static final Integer ZERO
public static final Integer PLUS
public static final Integer MINUS
public static final String BYTE_TYPE
public static final String CHAR_TYPE
public static final String SHORT_TYPE
public static final String INT_TYPE
public static final String LONG_TYPE
public static final String FLOAT_TYPE
public static final String DOUBLE_TYPE
public static final String BOOLEAN_TYPE
public static final String BYTE_CLASS_NAME
public static final String CHARACTER_CLASS_NAME
public static final String SHORT_CLASS_NAME
public static final String INTEGER_CLASS_NAME
public static final String LONG_CLASS_NAME
public static final String FLOAT_CLASS_NAME
public static final String DOUBLE_CLASS_NAME
public static final String BOOLEAN_CLASS_NAME
public static final String STRING_CLASS_NAME
public static final String OBJECT_CLASS_NAME
| Constructor Detail |
|---|
public Types()
| Method Detail |
|---|
public static boolean toBoolean(String str)
str - the string to convert.
public static byte toByte(String str)
str - the string to convert.
public static short toShort(String str)
str - the string to convert.
public static int toInt(String str)
str - the string to convert.
public static long toLong(String str)
str - the string to convert.
public static Number toNumber(String str,
String type)
str - the string to convert.type - the requested type.
public static boolean isNaN(Number number)
number - the number to check.
public static boolean isNumericType(String className,
boolean arrayp)
className - the class type to check.arrayp - true if an array type is accepted.
public static boolean isCharSequenceType(String className,
boolean arrayp)
className - the class type to check.arrayp - true if an array type is accepted.
public static boolean isStringType(String className,
boolean arrayp)
className - the class type to check.arrayp - true if an array type is accepted.
public static boolean isPrimitiveType(String className)
className - the class type to check.
public static boolean isArrayType(String className)
className - the class type to check.
public static Class toPrimitiveClass(String className)
className - the class name to convert.
public static Class toPrimitiveClass(Class clazz)
clazz - the class to convert.
public static Class toObjectClass(Class type)
type - the primitive type to convert.
public static String toComponentType(String className)
className - the array type to convert.
public static String toPrimitiveType(String className)
className - the object type to convert.
public static String toPrimitiveArrayType(String className)
className - the object type to convert.
public static String toObjectType(String primitive)
primitive - the primitive type to convert.
public static String toPlainType(Class clazz)
clazz - the class.
public static String toPlainType(String className)
className - the qualified class name.
public static ClassLoader getClassLoader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||