|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.util.JavaClassHelper
public class JavaClassHelper
Helper for questions about Java classes such as
what is the boxed type for a primitive type
is this a numeric type.
Constructor Summary | |
---|---|
JavaClassHelper()
|
Method Summary | |
---|---|
static java.lang.Number |
coerceNumber(java.lang.Number numToCoerce,
java.lang.Class resultType)
Coerce the given number to the given type. |
static java.lang.Class |
getArithmaticCoercionType(java.lang.Class typeOne,
java.lang.Class typeTwo)
Returns the coercion type for the 2 numeric types for use in arithmatic. |
static java.lang.Class |
getBoxedType(java.lang.Class clazz)
Returns the boxed class for the given class, or the class itself if already boxed or not a primitive type. |
static java.lang.Class |
getCompareToCoercionType(java.lang.Class typeOne,
java.lang.Class typeTwo)
Returns for 2 classes to be compared via relational operator the Class type of common comparison. |
static boolean |
isAssignmentCompatible(java.lang.Class parameterType,
java.lang.Class parameterization)
Returns true if 2 classes are assignment compatible. |
static boolean |
isBoolean(java.lang.Class clazz)
Determines if the class passed in is a boolean boxed or unboxed type. |
static boolean |
isFloatingPointClass(java.lang.Class clazz)
Returns true if the supplied type is a floating point number. |
static boolean |
isFloatingPointNumber(java.lang.Number number)
Returns true if the Number instance is a floating point number. |
static boolean |
isNumeric(java.lang.Class clazz)
Determines if the class passed in is one of the numeric classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaClassHelper()
Method Detail |
---|
public static java.lang.Class getBoxedType(java.lang.Class clazz)
clazz
- is the class to return the boxed class for
public static boolean isNumeric(java.lang.Class clazz)
clazz
- to check
public static final boolean isAssignmentCompatible(java.lang.Class parameterType, java.lang.Class parameterization)
parameterType
- type to assign fromparameterization
- type to assign to
public static boolean isBoolean(java.lang.Class clazz)
clazz
- to check
public static java.lang.Class getArithmaticCoercionType(java.lang.Class typeOne, java.lang.Class typeTwo)
typeOne
- typeTwo
-
public static java.lang.Number coerceNumber(java.lang.Number numToCoerce, java.lang.Class resultType)
numToCoerce
- is the number to coerce to the given typeresultType
- is the result type to return
public static boolean isFloatingPointNumber(java.lang.Number number)
number
- to check
public static boolean isFloatingPointClass(java.lang.Class clazz)
clazz
- to check
public static java.lang.Class getCompareToCoercionType(java.lang.Class typeOne, java.lang.Class typeTwo)
typeOne
- typeTwo
-
java.lang.IllegalArgumentException
- if the types cannot be compared
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |