public final class Interpreter extends Object
(c) copyright 2002-2005 Delft
University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , no warranty.
| Modifier and Type | Field and Description |
|---|---|
static FactoryInterface |
INTERPRETER_FACTORY
the interpreter factory class name
|
| Modifier and Type | Method and Description |
|---|---|
static Frame |
aThrow(Operation operation,
Frame frame,
Stack frameStack)
throws an exception
|
static Frame |
createFrame(Object object,
AccessibleObject method,
Object[] arguments)
creates a frame for a method
|
static Object |
interpret(Stack frameStack)
interprets the frameStack
|
static Object |
invoke(Object object,
AccessibleObject method,
Object[] arguments)
interpretes the invocation of a method on an object
|
static Object |
invoke(Object object,
String methodName,
Object[] arguments,
Class[] argumentTypes)
interpretes the invocation of a method on an object
|
static void |
setFactory(FactoryInterface factory)
sets the Interpreter factory.
|
public static FactoryInterface INTERPRETER_FACTORY
public static void setFactory(FactoryInterface factory)
factory - the factory to usepublic static Frame createFrame(Object object, AccessibleObject method, Object[] arguments) throws ClassNotFoundException, IOException
object - the object on which the method must be invokedmethod - the method or constructorarguments - the argumentsClassNotFoundException - whenever the classpath is incompleteIOException - on IOExceptionpublic static Frame aThrow(Operation operation, Frame frame, Stack frameStack)
operation - the aThrow operation to invokeframe - the frame to start withframeStack - the framestackpublic static Object interpret(Stack frameStack) throws InterpreterException
frameStack - the frameStack of the interpreterInterpreterException - on failurepublic static Object invoke(Object object, String methodName, Object[] arguments, Class[] argumentTypes)
object - the object on which the method must be invokedmethodName - the methodNamearguments - the argumentsargumentTypes - the classes of the argumentspublic static Object invoke(Object object, AccessibleObject method, Object[] arguments) throws InterpreterException
object - the object on which the method must be invokedmethod - the methodarguments - the argumentsInterpreterException - on failureCopyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.