|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.sf.jauvm.Interpreter
public class Interpreter
A JVM byte code interpreter.
AnInterpreter object wraps a given Runnable object, interpreting that object's run() method
when its own run() method is invoked.
This class also holds this library's main(String[] args) method, that receives a fully qualified class name
as its first argument and interprets that class's main(String[] args) method, passing it the remainder of
its arguments.
Only methods tagged as interpretable are interpreted by an Interpreter.
interpretable| Constructor Summary | |
|---|---|
Interpreter(Continuation cont)
Constructs a new Interpreter object to return to the specified Continuation object's
stored execution point. |
|
Interpreter(Runnable run)
Constructs a new Interpreter object to interpret the specified Runnable object. |
|
| Method Summary | |
|---|---|
static void |
main(String... args)
The framework's main(String[] args) method. |
void |
run()
Runs this Interpreter object, interpreting the underlying Runnable object's run() method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Interpreter(Runnable run)
Interpreter object to interpret the specified Runnable object.
run - the Runnable object whose run() method is to be interpreted
NullPointerException - if run is nullpublic Interpreter(Continuation cont)
Interpreter object to return to the specified Continuation object's
stored execution point.
Invoking this constructor has the same effect as:
new Interpreter(new Runnable() {
public @interpretable void run() {
cont.returnTo();
}
});
The given Continuation must be of void return type.
cont - the Continuation object to which to return to
NullPointerException - if cont is null
IllegalArgumentException - if cont is not of void return typeContinuation.getReturnType()| Method Detail |
|---|
public final void run()
Interpreter object, interpreting the underlying Runnable object's run() method.
run in interface RunnableUndeclaredThrowableException - if the underlying Runnable object's run() method throws a
checked exception
public static void main(String... args)
throws Throwable
main(String[] args) method.
Loads the class specified by the first argument and interprets that class's main(String[] args) method,
passing it the remainder of the arguments.
Alternatively, loads a serialized continuation from a file and returns to it, through the use of the
Interpreter(Continuation) constructor.
args - the first argument is the fully qualified name of the class to interpret, and the remainder of the
arguments are passed to that class's main(String[] args) method; alternatively, the first argument
is -ser and the second argument is the file from which to load the continuation
Throwable - any exception thrown as the result of trying to execute the classe's main(String[] args) method, or returning to the continuationInterpreter(Continuation)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||