|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkoala.dynamicjava.interpreter.InterpreterUtilities
This class contains a collection of utility methods for interpretation
Nested Class Summary | |
protected static class |
InterpreterUtilities.AddOperation
To encapsulate + |
protected static class |
InterpreterUtilities.BinaryArithmeticOperation
To encapsulate a binary operator |
protected static class |
InterpreterUtilities.BinaryPredicate
To encapsulate a boolean binary operator |
protected static class |
InterpreterUtilities.BitAndOperation
To encapsulate & |
protected static class |
InterpreterUtilities.BitOrOperation
To encapsulate | |
protected static class |
InterpreterUtilities.BitwiseOperation
To encapsulate a bitwise operator |
protected static class |
InterpreterUtilities.DivideOperation
To encapsulate / |
protected static class |
InterpreterUtilities.EqualToPredicate
To encapsulate == |
protected static class |
InterpreterUtilities.GreaterOrEqualOperation
To encapsulate >= |
protected static class |
InterpreterUtilities.GreaterThanOperation
To encapsulate > |
protected static class |
InterpreterUtilities.LessOrEqualOperation
To encapsulate <= |
protected static class |
InterpreterUtilities.LessThanOperation
To encapsulate < |
protected static class |
InterpreterUtilities.MinusOperation
To encapulate - |
protected static class |
InterpreterUtilities.MultiplyOperation
To encapsulate * |
protected static class |
InterpreterUtilities.NotEqualToPredicate
To encapsulate != |
protected static class |
InterpreterUtilities.PlusOperation
To encapulate + |
protected static class |
InterpreterUtilities.RelationalOperation
To encapsulate a relational operation |
protected static class |
InterpreterUtilities.RemainderOperation
To encapsulate % |
protected static class |
InterpreterUtilities.ShiftLeftOperation
To encapsulate << |
protected static class |
InterpreterUtilities.ShiftOperation
To encapsulate a shift operator |
protected static class |
InterpreterUtilities.ShiftRightOperation
To encapsulate >> |
protected static class |
InterpreterUtilities.SubtractOperation
To encapsulate - |
protected static class |
InterpreterUtilities.UnaryOperation
To encapsulate an unary operator |
protected static class |
InterpreterUtilities.UnsignedShiftRightOperation
To encapsulate >>> |
protected static class |
InterpreterUtilities.XOrOperation
To encapsulate ^ |
Field Summary | |
static java.lang.Byte |
ONE
|
Constructor Summary | |
protected |
InterpreterUtilities()
This class contains only static methods, so it is not useful to create instances of it. |
Method Summary | |
static java.lang.Object |
add(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of an addition |
protected static java.lang.Object |
binaryArithmeticOperation(java.lang.Class c,
java.lang.Object l,
java.lang.Object r,
InterpreterUtilities.BinaryArithmeticOperation o)
Returns the value of a binary arithmetic operation |
static java.lang.Object |
bitAnd(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a bit and operation |
static java.lang.Object |
bitOr(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a bit or operation |
protected static java.lang.Object |
bitwiseOperation(java.lang.Class c,
java.lang.Object l,
java.lang.Object r,
InterpreterUtilities.BitwiseOperation o)
Returns the value of a bitwise operation |
static java.lang.Object |
divide(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a division |
protected static java.lang.Object |
equalityOperation(java.lang.Class lc,
java.lang.Class rc,
java.lang.Object l,
java.lang.Object r,
InterpreterUtilities.BinaryPredicate p)
Returns the value of an equality operation |
static java.lang.Object |
equalTo(java.lang.Class lc,
java.lang.Class rc,
java.lang.Object l,
java.lang.Object r)
Returns the value of an equal to operation |
static java.lang.Class |
getDeclaringClass(java.lang.Class c)
Returns the declaring class of the given class |
static java.lang.reflect.Field |
getOuterField(java.lang.Class cl,
java.lang.String name)
Returns a field with the given name declared in one of the outer classes of the given class |
static java.lang.Object |
greaterOrEqual(java.lang.Object l,
java.lang.Object r)
Returns the value of a greater or equal operation |
static java.lang.Object |
greaterThan(java.lang.Object l,
java.lang.Object r)
Returns the value of a greater than operation |
static boolean |
isValidAssignment(java.lang.Class lc,
java.lang.Object val)
|
static java.lang.Object |
lessOrEqual(java.lang.Object l,
java.lang.Object r)
Returns the value of a less or equal operation |
static java.lang.Object |
lessThan(java.lang.Object l,
java.lang.Object r)
Returns the value of a less than operation |
static java.lang.reflect.Method |
lookupOuterMethod(java.lang.Class cl,
java.lang.String name,
java.lang.Class[] ac)
Looks up for a method in an outer classes of this class. |
static java.lang.Object |
minus(java.lang.Class c,
java.lang.Object o)
Returns the value of an unary - operation |
static java.lang.Object |
multiply(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a product |
static java.lang.Object |
notEqualTo(java.lang.Class lc,
java.lang.Class rc,
java.lang.Object l,
java.lang.Object r)
Returns the value of a not equal to operation |
static java.lang.Object |
plus(java.lang.Class c,
java.lang.Object o)
Returns the value of an unary + operation |
protected static java.lang.Object |
relationalOperation(java.lang.Object l,
java.lang.Object r,
InterpreterUtilities.RelationalOperation o)
Returns the value of a relational operation |
static java.lang.Object |
remainder(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of remainder of a division |
static java.lang.Object |
shiftLeft(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a shift left operation |
protected static java.lang.Object |
shiftOperation(java.lang.Class c,
java.lang.Object l,
java.lang.Object r,
InterpreterUtilities.ShiftOperation o)
Returns the value of a shift operation |
static java.lang.Object |
shiftRight(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a shift right operation |
static java.lang.Object |
subtract(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a subtraction |
static java.lang.Object |
unaryOperation(java.lang.Class c,
java.lang.Object o,
InterpreterUtilities.UnaryOperation u)
Returns the value of an unary operation |
static java.lang.Object |
unsignedShiftRight(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of an unsigned shift right operation |
static java.lang.Object |
xOr(java.lang.Class c,
java.lang.Object l,
java.lang.Object r)
Returns the value of a xor operation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Byte ONE
Constructor Detail |
protected InterpreterUtilities()
Method Detail |
public static java.lang.Object equalTo(java.lang.Class lc, java.lang.Class rc, java.lang.Object l, java.lang.Object r)
lc
- the class of the left operandrc
- the class of the right operandl
- the left operandr
- the right operandpublic static java.lang.Object notEqualTo(java.lang.Class lc, java.lang.Class rc, java.lang.Object l, java.lang.Object r)
lc
- the class of the left operandrc
- the class of the right operandl
- the left operandr
- the right operandprotected static java.lang.Object equalityOperation(java.lang.Class lc, java.lang.Class rc, java.lang.Object l, java.lang.Object r, InterpreterUtilities.BinaryPredicate p)
lc
- the class of the left operandrc
- the class of the right operandl
- the left operandr
- the right operandp
- the predicate to usepublic static java.lang.Object add(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object subtract(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object multiply(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object divide(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object remainder(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandprotected static java.lang.Object binaryArithmeticOperation(java.lang.Class c, java.lang.Object l, java.lang.Object r, InterpreterUtilities.BinaryArithmeticOperation o)
c
- the class of the resultl
- the left operandr
- the right operando
- the operationpublic static java.lang.Object lessThan(java.lang.Object l, java.lang.Object r)
l
- the left operandr
- the right operandpublic static java.lang.Object lessOrEqual(java.lang.Object l, java.lang.Object r)
l
- the left operandr
- the right operandpublic static java.lang.Object greaterThan(java.lang.Object l, java.lang.Object r)
l
- the left operandr
- the right operandpublic static java.lang.Object greaterOrEqual(java.lang.Object l, java.lang.Object r)
l
- the left operandr
- the right operandprotected static java.lang.Object relationalOperation(java.lang.Object l, java.lang.Object r, InterpreterUtilities.RelationalOperation o)
l
- the left operandr
- the right operando
- the operationpublic static java.lang.Object bitAnd(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object xOr(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object bitOr(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandprotected static java.lang.Object bitwiseOperation(java.lang.Class c, java.lang.Object l, java.lang.Object r, InterpreterUtilities.BitwiseOperation o)
c
- the class of the resultl
- the left operandr
- the right operando
- the operationpublic static java.lang.Object shiftLeft(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object shiftRight(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandpublic static java.lang.Object unsignedShiftRight(java.lang.Class c, java.lang.Object l, java.lang.Object r)
c
- the class of the resultl
- the left operandr
- the right operandprotected static java.lang.Object shiftOperation(java.lang.Class c, java.lang.Object l, java.lang.Object r, InterpreterUtilities.ShiftOperation o)
c
- the class of the resultl
- the left operandr
- the right operando
- the operationpublic static java.lang.Object plus(java.lang.Class c, java.lang.Object o)
c
- the class of the resulto
- the operandpublic static java.lang.Object minus(java.lang.Class c, java.lang.Object o)
c
- the class of the resulto
- the operandpublic static java.lang.Object unaryOperation(java.lang.Class c, java.lang.Object o, InterpreterUtilities.UnaryOperation u)
c
- the class of the resulto
- the operandu
- the operationpublic static java.lang.Class getDeclaringClass(java.lang.Class c)
public static java.lang.reflect.Field getOuterField(java.lang.Class cl, java.lang.String name) throws java.lang.NoSuchFieldException, AmbiguousFieldException
cl
- the inner classname
- the name of the field
java.lang.NoSuchFieldException
AmbiguousFieldException
public static java.lang.reflect.Method lookupOuterMethod(java.lang.Class cl, java.lang.String name, java.lang.Class[] ac) throws java.lang.NoSuchMethodException
cl
- the inner classname
- the name of the methodac
- the arguments classes (possibly not the exact declaring classes)
java.lang.NoSuchMethodException
public static boolean isValidAssignment(java.lang.Class lc, java.lang.Object val)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |