|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kmy.jint.util.AnyUtilities
AnyUtilities is a class with many static methods that are used to support kmy.jint.lang.Any pseudo-class at runtime.
Values that are explicitly or implicitly declared as Any are really just Objects, but all operations on them are deferred till runtime. For example, accessing a field of such object requires dynamic lookup through java reflection.
There is also a special case of Any - an object that implements kmy.jint.util.Dispatch interface. These objects are given opportunity to handle field access and method invocation themselves.
Inner Class Summary | |
(package private) static class |
AnyUtilities.CacheEntry
|
(package private) static class |
AnyUtilities.FCacheEntry
|
Field Summary | |
private static AnyUtilities.CacheEntry[] |
cache
|
private static int |
CACHE_BITS
|
private static int |
CACHE_MASK
|
private static int |
CACHE_SIZE
|
static boolean |
cacheOff
|
private static ClassUtilities |
cutilities
|
private static java.lang.reflect.Method[] |
EMPTY
|
private static java.lang.Class[] |
EMPTYT
|
private static AnyUtilities.FCacheEntry[] |
fcache
|
private static java.lang.Object |
lock
|
static int |
MATCH_FAIL
|
static int |
MATCH_OK
|
static int |
MATCH_PERFECT
|
private static java.lang.Object |
NULL
|
private static java.lang.Class[] |
OBJCLASS
|
private static ClassUtilities |
utilities
|
Constructor Summary | |
AnyUtilities()
|
Method Summary | |
(package private) static void |
|
static java.lang.Object |
callMethod(java.lang.Object target,
java.lang.Class targetClass,
java.lang.String name,
java.lang.Class[] types,
java.lang.Object[] args,
int cacheId)
Calls targetClass's method that is named name and has signature that matches parameter types given in argument type using instance specified by target. |
static java.lang.Object |
callMethod(java.lang.Object target,
java.lang.String name,
java.lang.Class[] types,
java.lang.Object[] args,
int cacheId)
Same as the other callMethod method, with targetClass = target.getClass(). |
static java.lang.Object |
callMethod0(java.lang.Object target,
java.lang.Class targetClass,
java.lang.String name,
java.lang.Class[] types,
java.lang.Object[] args,
int cacheId)
Calls target's method that is named name and has signature that matches parameter types given in argument type. |
static java.lang.Class |
commonClass(java.lang.Class c1,
java.lang.Class c2)
Given two classes that represent numbers, returns the class that should be used to store the result of operation (like '+' or '*") applied to the objects of these classes. |
static boolean |
cond(int op,
java.lang.Object arg1,
java.lang.Object arg2)
Evaluates condition (like '<' or '>') on a pair of objects. |
static java.lang.Object[] |
convertArgs(java.lang.Object[] args,
java.lang.Class[] types)
Converts actaul parameter values in array args to types specified in array types. |
static java.lang.Object |
convertNumber(java.lang.Object in,
java.lang.Class clazz)
Converts a number object in into an object specified by class clazz. |
static java.lang.reflect.Field |
findField(java.lang.Object target,
java.lang.String name,
int cacheId)
Find a field in the class of target by its name. |
static java.lang.Object |
getElement(java.lang.Object table,
java.lang.Object key)
Returns an element of a vector or dictionary table by its index or key key. |
static java.lang.Object |
getField(java.lang.Object target,
java.lang.String name,
int cacheID)
Returns value of the field name in object target. |
static java.lang.Object |
getField0(java.lang.Object target,
java.lang.String name,
int cacheID)
Returns value of the field name in object target. |
static int |
intValue(java.lang.Object v)
Returns integer value of Character or Number object. |
static boolean |
isWrapped(java.lang.Object obj)
Returns true if obj is a wrapper object, such as Boolean or Character. |
static int |
match(java.lang.Class value,
java.lang.Class var)
Matches actual parameter or value type (value) with formal parameter or variable type (var). |
static java.lang.Object |
newAny()
This method is called to implement Jint 'new Any()' expression. |
static java.lang.Object |
op(int op,
java.lang.Object arg1)
Performs a prefix operation on an object. |
static java.lang.Object |
op(int op,
java.lang.Object arg1,
java.lang.Object arg2)
Performs an infix operation on a pair of objects. |
static void |
putElement(java.lang.Object table,
java.lang.Object key,
java.lang.Object value)
Sets element of a vector or dictionary table by its index or key key to value. |
static void |
setField(java.lang.Object target,
java.lang.Object value,
java.lang.String name,
int cacheID)
Sets value of the field name in object target to value. |
static void |
setField0(java.lang.Object target,
java.lang.Object value,
java.lang.String name,
int cacheID)
Sets value of the field name in object target. |
static java.lang.Object |
shift(int op,
java.lang.Object arg,
int sh)
Performs shift ( '<<', '>>', or '>>>' ) on an object. |
static java.lang.Object |
textSearch(java.lang.Object text,
java.lang.Object textProc)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Field Detail |
private static final java.lang.reflect.Method[] EMPTY
private static final java.lang.Class[] OBJCLASS
private static final java.lang.Object NULL
private static final java.lang.Class[] EMPTYT
public static final int MATCH_OK
public static final int MATCH_PERFECT
public static final int MATCH_FAIL
public static final boolean cacheOff
private static ClassUtilities utilities
private static ClassUtilities cutilities
private static java.lang.Object lock
private static int CACHE_BITS
private static int CACHE_SIZE
private static int CACHE_MASK
private static AnyUtilities.CacheEntry[] cache
private static AnyUtilities.FCacheEntry[] fcache
Constructor Detail |
public AnyUtilities()
Method Detail |
static void()
public static java.lang.Object convertNumber(java.lang.Object in, java.lang.Class clazz)
public static boolean isWrapped(java.lang.Object obj)
public static java.lang.Class commonClass(java.lang.Class c1, java.lang.Class c2)
public static int match(java.lang.Class value, java.lang.Class var)
public static java.lang.reflect.Field findField(java.lang.Object target, java.lang.String name, int cacheId) throws DispatchException
public static java.lang.Object getField0(java.lang.Object target, java.lang.String name, int cacheID) throws DispatchException
public static java.lang.Object getField(java.lang.Object target, java.lang.String name, int cacheID)
public static void setField0(java.lang.Object target, java.lang.Object value, java.lang.String name, int cacheID) throws DispatchException
public static void setField(java.lang.Object target, java.lang.Object value, java.lang.String name, int cacheID)
public static java.lang.Object callMethod0(java.lang.Object target, java.lang.Class targetClass, java.lang.String name, java.lang.Class[] types, java.lang.Object[] args, int cacheId) throws java.lang.Exception
public static java.lang.Object callMethod(java.lang.Object target, java.lang.Class targetClass, java.lang.String name, java.lang.Class[] types, java.lang.Object[] args, int cacheId) throws java.lang.Exception
public static java.lang.Object callMethod(java.lang.Object target, java.lang.String name, java.lang.Class[] types, java.lang.Object[] args, int cacheId) throws java.lang.Exception
public static java.lang.Object[] convertArgs(java.lang.Object[] args, java.lang.Class[] types)
public static java.lang.Object op(int op, java.lang.Object arg1)
public static java.lang.Object op(int op, java.lang.Object arg1, java.lang.Object arg2)
public static boolean cond(int op, java.lang.Object arg1, java.lang.Object arg2)
public static java.lang.Object shift(int op, java.lang.Object arg, int sh)
public static int intValue(java.lang.Object v)
public static java.lang.Object getElement(java.lang.Object table, java.lang.Object key)
public static void putElement(java.lang.Object table, java.lang.Object key, java.lang.Object value)
public static java.lang.Object newAny()
public static java.lang.Object textSearch(java.lang.Object text, java.lang.Object textProc)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |