|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.tudelft.simulation.language.primitives.Primitive
public final class Primitive
The Primitive class is a utility class to deal with primitives. Besides widening and unwidening this class casts and parses UTF8 strings into appropriate primitive classes.
(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl/language
License of use: Lesser
General Public License (LGPL) , no warranty
Method Summary | |
---|---|
static Object[] |
cast(Class[] classes,
Object[] values)
casts a set of values to classes |
static Object |
cast(Class clazz,
Object object)
casts an object to a instance of clazz |
static Class |
forName(String className)
returns the primitiveClass of the name given as defined by the Java VM class constants. |
static Class |
getPrimitive(Class wrapperClass)
gets the primitive of the given wrapperClass |
static Class |
getWrapper(Class primitiveClass)
gets the wrapper of this primitive class |
static Boolean |
toBoolean(Object object)
casts an object to Boolean |
static Byte |
toByte(Object object)
casts an object to Byte |
static Character |
toCharacter(Object object)
casts an object to Character |
static Double |
toDouble(Object object)
casts an object to Double |
static Float |
toFloat(Object object)
casts an object to Float |
static Integer |
toInteger(Object object)
casts an object to Integer |
static Long |
toLong(Object object)
casts an object to Long |
static Short |
toShort(Object object)
casts an object to Short |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object[] cast(Class[] classes, Object[] values)
classes
- the classes to cast tovalues
- the values
public static Object cast(Class clazz, Object object)
clazz
- the class to cast toobject
- the object to cast
public static Class forName(String className)
className
- the className
public static Class getPrimitive(Class wrapperClass)
wrapperClass
- the wrapper class
public static Class getWrapper(Class primitiveClass)
primitiveClass
- the primitive class
public static Boolean toBoolean(Object object)
object
- the object
public static Byte toByte(Object object)
object
- the object
public static Character toCharacter(Object object)
object
- the object to parse
public static Double toDouble(Object object)
object
- the object to parse
public static Float toFloat(Object object)
object
- the object to parse
public static Long toLong(Object object)
object
- the object to parse
public static Short toShort(Object object)
object
- the object to parse
public static Integer toInteger(Object object)
object
- the object to parse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |