|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mit.ai.psg.jevaES.TypeMethods
Predicates and Methods for testing and comparing types.
| Method Summary | |
static Class |
binaryCombineBitwiseTypes(Token operator,
Class cX,
Class cY)
|
static Class |
binaryCombineNumericTypes(Token operator,
Class cX,
Class cY)
|
static Class |
binaryCombineShiftTypes(Token operator,
Class leftType,
Class rightType)
|
static Class |
binaryPromoteType(Class cX,
Class cY)
[JavaLangSpec1.0 sec 5.6.2 Binary Numeric Promotion] |
static boolean |
canNarrowPrimitive(Class to,
Class from)
[JavaLangSpec1.0 sec 5.1.3 Narrowing Primitive Conversions] |
static boolean |
canNarrowPrimitiveConstant(Class receivingType,
Class exprType,
IExpressionNode expr,
IEnv env)
[JavaLangSpec1.0 sec 5.2, 15.24] check if expr is integer constant that fits in char, short, or byte. |
static boolean |
canNarrowReference(Class to,
Class from)
[JavaLangSpec1.0 sec 5.1.5 Narrowing Reference Conversions] (does not check for methods that differ only in return type) |
static boolean |
canWidenPrimitive(Class to,
Class from)
[JavaLangSpec1.0 sec 5.1.2 Widening Primitive Conversions] |
static boolean |
canWidenReference(Class to,
Class from)
[JavaLangSpec1.0 sec 5.1.4 Widening Reference Conversions] |
static void |
checkCastTypes(Class castType,
Class exprType)
check for impermissible casts [JavaLangSpec1.0 sec 5.5 Casting Conversion] |
static boolean |
isAbstractClass(Class aClass)
|
static boolean |
isApplicable(Class[] parameterTypes,
Class[] argExprTypes)
|
static boolean |
isApplicable(Constructor constructor,
Class[] argExprTypes)
|
static boolean |
isApplicable(Method method,
Class[] argExprTypes)
[JavaLangSpec 15.11.2.1 Find Methods that are applicable (& accessible)] Accessibility is not a concern, since only public methods are accessiblethrough reflection. |
static boolean |
isAssignable(Class receivingType,
IExpressionNode expr,
IEnv env)
[JavaLangSpec1.0 sec 5.2 Assignment Conversion] This checks for primitive as well as reference widenings. |
static boolean |
isBindableType(Class receivingType,
Class exprType)
[JavaLangSpec1.0 sec 5.3 Method Invocation Conversion] |
static boolean |
isCaughtOrDeclaredException(Class exceptionClass,
Class[] caughtOrDeclareds)
|
static boolean |
isClassType(Class type)
Class is not primitive, array, nor interface |
static boolean |
isFinalClass(Class aClass)
|
static boolean |
isImplementation(Class sub,
Class anInterface)
|
static boolean |
isIntegralType(Class type)
primitive integer types of various sizes (byte, short, int, long) |
static boolean |
isIntExpression(IExpressionNode expr,
IEnv env)
Check that array dims/indexes are int [JavaLangSpec1.0 sec15.9, 15.12] |
static boolean |
isMoreSpecific(Constructor c1,
Constructor c2)
|
static boolean |
isMoreSpecific(Method m1,
Method m2)
[JavaLangSpec 15.11.2.2 Choose Most Specific Method] Assumes method name matches |
static boolean |
isNumericType(Class type)
primitive numeric types |
static boolean |
isReferenceType(Class type)
|
static boolean |
isSubclass(Class sub,
Class aSuper)
|
static boolean |
isSubinterface(Class sub,
Class aSuper)
|
static boolean |
isThrowableClass(Throwable thrown,
Class[] throwClasses)
[JavaLangSpec 14.16 Throw statement] |
static boolean |
isUncheckedException(Class exceptionClass)
|
static Class |
makeArrayType(Class baseType,
int nDims)
|
static Class |
nameToPrimitiveType(String name)
Get primitive type from its name, e.g., for "long" return long.class |
static Class |
toPrimitiveType(Class wrapperType)
Get primitive type associated with wrapper, e.g., for a new Long(0) return long.class |
static String |
toSourceString(Class type)
Return source code declaration string for class even if it is an array, e.g., "int[][]" instead of "[[I", which is what type.getName() returns |
static Class |
unaryPromoteType(Class type)
[JavaLangSpec1.0 sec 5.6.1 Unary Numeric Promotion] |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public static final boolean isReferenceType(Class type)
public static final boolean isClassType(Class type)
public static final boolean isNumericType(Class type)
public static final boolean isIntegralType(Class type)
public static final Class unaryPromoteType(Class type)
public static final Class binaryPromoteType(Class cX,
Class cY)
public static final Class binaryCombineNumericTypes(Token operator,
Class cX,
Class cY)
public static final Class binaryCombineBitwiseTypes(Token operator,
Class cX,
Class cY)
public static final Class binaryCombineShiftTypes(Token operator,
Class leftType,
Class rightType)
public static final boolean isAssignable(Class receivingType,
IExpressionNode expr,
IEnv env)
throws VerifyingException
public static final boolean isBindableType(Class receivingType,
Class exprType)
public static final boolean canWidenPrimitive(Class to,
Class from)
public static final boolean canNarrowPrimitiveConstant(Class receivingType,
Class exprType,
IExpressionNode expr,
IEnv env)
throws VerifyingException
public static final boolean canNarrowPrimitive(Class to,
Class from)
public static final boolean canWidenReference(Class to,
Class from)
public static final boolean isFinalClass(Class aClass)
public static final boolean isAbstractClass(Class aClass)
public static final boolean isSubinterface(Class sub,
Class aSuper)
public static final boolean isSubclass(Class sub,
Class aSuper)
public static final boolean isImplementation(Class sub,
Class anInterface)
public static final boolean canNarrowReference(Class to,
Class from)
public static final Class toPrimitiveType(Class wrapperType)
public static final Class nameToPrimitiveType(String name)
throws ClassNotFoundException
public static final String toSourceString(Class type)
public static final Class makeArrayType(Class baseType,
int nDims)
public static final void checkCastTypes(Class castType,
Class exprType)
public static boolean isThrowableClass(Throwable thrown,
Class[] throwClasses)
public static final boolean isApplicable(Method method,
Class[] argExprTypes)
public static final boolean isApplicable(Constructor constructor,
Class[] argExprTypes)
public static final boolean isApplicable(Class[] parameterTypes,
Class[] argExprTypes)
public static final boolean isMoreSpecific(Method m1,
Method m2)
public static final boolean isMoreSpecific(Constructor c1,
Constructor c2)
public static final boolean isIntExpression(IExpressionNode expr,
IEnv env)
throws VerifyingException
public static boolean isUncheckedException(Class exceptionClass)
public static boolean isCaughtOrDeclaredException(Class exceptionClass,
Class[] caughtOrDeclareds)
|
Copyright (c) 1996-1999 Massachusetts Institute of Technology Feedback: jeva-feedback@ai.mit.edu |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||