|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A basic interface that an object implements to be
considered an evaluator in the current Omegahat
language. At present, the evaluator hieararchy is relatively
linear and so the methods are inherited from
BasicEvaluator.
The methods control
| Field Summary | |
static java.lang.String |
ThisVariableName
|
| Method Summary | |
int |
addEvaluationListener(EvaluationListener l)
Register an object to be notified of evaluation events such as the beginning and end of a top-level task, an error, and the start of the evaluation of a sub-expression within the expression tree of a task. |
int |
addFunctionTable(java.lang.Object source)
Add the specified object to the list of elements that are searched when a function-like call is evaluated and no function is found. |
boolean |
addMethod(Method method,
Name name)
|
boolean |
allowUnrestrictedAccess()
Indicate whether access to methods and fields that are not usually accessible (non-public classes and/or methods and fields) are tolerated. |
java.lang.Object |
asObject(Name n)
|
java.lang.String |
asObjectName(Name n)
|
java.lang.Class |
asPrimitiveClass(java.lang.String name)
Return the primitive class (that is, double,
int, etc.) corresponding the specified
string of the form "double", etc. |
boolean |
assign(java.lang.String name,
java.lang.Object value)
|
boolean |
assign(java.lang.String name,
java.lang.Object value,
Database db)
|
AttachedDatabase |
attach(Database db)
|
AttachedDatabase |
attach(Database db,
int position)
|
java.lang.Object |
convertPrimitive(java.lang.Object value,
java.lang.Class target)
Convert an object to a primitive object such as an Integer to a Double or vice-versa. |
ExpressionInt |
currentExpression()
Retrieve the current sub-expression being evaluated. |
ExpressionInt |
currentExpression(ExpressionInt expr)
Set the current sub-expression being evaluated. |
boolean |
Debug()
|
boolean |
Debug(java.lang.Object src)
|
Database |
defaultDatabase()
Retrieve the database into which assignments are made by default (i.e. |
Database |
defaultDatabase(Database db)
Set the database to which assignments are made by default. |
int |
detach(Database db)
|
int |
detach(int which)
|
java.lang.Exception |
error(java.lang.String msg)
Signal an error, using the error message to indicate why. |
java.lang.Exception |
error(java.lang.Throwable e,
java.lang.String msg)
Raise an error based on the exception that was caught during the evaluation of the current top-level task. |
java.lang.Object |
evaluate(ExpressionInt expression)
|
java.lang.Object |
evaluate(java.lang.String input)
|
boolean |
exists(java.lang.String name)
|
void |
exit(int value)
Terminate the session as quickly as possibly |
java.lang.Class |
findClass(Name name)
Find the Class object
corresponding to a multi-component Name
object. |
java.lang.Class |
findClass(java.lang.String name)
Locate a Class object
with the given name, using incomplete matching
such as Vector or util.Vector
to resolve Vector. |
Evaluable |
findFunctionOrMethod(java.lang.String name)
|
OrderedTable |
functionTableList()
Retrieve a list of all the potential sources of methods that are invokable as functions. |
java.lang.Object |
get(java.lang.String name)
|
java.lang.Object |
get(java.lang.String name,
java.lang.Class type)
|
Database |
newDatabase(java.lang.String name)
|
java.lang.String[] |
objects(int which)
|
Options |
options()
Get the current Options object in effect for this evaluator. |
Options |
options(Options opts)
Set the Options object for the evaluator. |
ExpressionInt |
parse(java.lang.String input)
|
boolean |
q()
|
boolean |
remove(java.lang.String name)
|
boolean |
removeFunctionTable(java.lang.Object o)
Remove the specified object from the list of internal function tables used to resolve function-like calls. |
SearchPath |
searchPath()
|
SearchPath |
searchPath(SearchPath path)
|
java.lang.Object |
source(java.io.File f)
Read and evaluate task inputs from a file. |
java.lang.Object |
source(java.lang.Object o)
Read evaluable input from an arbitrary object in a manner suitable for its class (including throwing an exception). |
java.lang.Object |
source(java.lang.String src)
Read and evaluate input from a string, by attempting to treat it as a URL, a File and then an expression. |
java.lang.Object |
source(java.net.URL u)
Read and evaluate input from a URL. |
java.util.Stack |
sourceStack()
Retrieve the stack detailing the ordered list of input sources currently active. |
java.io.PrintWriter |
stderr()
Return the current error output device. |
java.io.PrintWriter |
stdout()
Return the current output device. |
ExpressionInt |
toplevelExpression()
Retrieve the current top-level task expression being evaluated. |
void |
warning(java.lang.String msg)
Register the specified warning message to be displayed at a suitable time, usually when the active task has been completed. |
void |
warning(java.lang.String msg,
boolean immediate)
|
void |
warning(java.lang.Throwable e,
java.lang.String msg)
Issue a warning about the exception that was caught at some point in the evaluation of the current task. |
Database[] |
where(java.lang.String name)
|
Database |
which(java.lang.String name)
Identifies the first database in the evaluator's search path in which a variable with this name can be found |
| Field Detail |
public static final java.lang.String ThisVariableName
| Method Detail |
public SearchPath searchPath()
public SearchPath searchPath(SearchPath path)
public AttachedDatabase attach(Database db)
public AttachedDatabase attach(Database db,
int position)
public int detach(int which)
public int detach(Database db)
public boolean assign(java.lang.String name,
java.lang.Object value)
throws java.lang.Exception
public boolean assign(java.lang.String name,
java.lang.Object value,
Database db)
throws java.lang.Exception
public boolean addMethod(Method method,
Name name)
public java.lang.Object get(java.lang.String name)
throws ObjectNotFoundException
public java.lang.String[] objects(int which)
throws java.lang.Exception
public boolean remove(java.lang.String name)
public boolean exists(java.lang.String name)
public Database[] where(java.lang.String name)
public java.lang.Object get(java.lang.String name,
java.lang.Class type)
throws ObjectNotFoundException
public java.lang.Object asObject(Name n)
throws java.lang.Throwable
public java.lang.Object evaluate(java.lang.String input)
public java.lang.Object evaluate(ExpressionInt expression)
throws java.lang.Throwable
public ExpressionInt parse(java.lang.String input)
throws java.lang.Exception
public Database newDatabase(java.lang.String name)
public boolean q()
public void exit(int value)
public int addEvaluationListener(EvaluationListener l)
public Database defaultDatabase()
assign(java.lang.String, java.lang.Object)public Database defaultDatabase(Database db)
public Database which(java.lang.String name)
public Evaluable findFunctionOrMethod(java.lang.String name)
throws ObjectNotFoundException
public java.lang.String asObjectName(Name n)
public Options options()
Options object in effect for this evaluator.public Options options(Options opts)
Options object for the evaluator.public ExpressionInt currentExpression()
public ExpressionInt currentExpression(ExpressionInt expr)
public ExpressionInt toplevelExpression()
public java.util.Stack sourceStack()
public boolean Debug()
public boolean Debug(java.lang.Object src)
public java.lang.Exception error(java.lang.String msg)
public java.lang.Exception error(java.lang.Throwable e,
java.lang.String msg)
public void warning(java.lang.Throwable e,
java.lang.String msg)
public void warning(java.lang.String msg)
public void warning(java.lang.String msg,
boolean immediate)
msg - the message textimmediate - whether to print the message now or wait until the
other warnings are issued (e.g. at the end of the task).
public java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
Class object
with the given name, using incomplete matching
such as Vector or util.Vector
to resolve Vector.
public java.lang.Class findClass(Name name)
throws java.lang.ClassNotFoundException
Class object
corresponding to a multi-component Name
object.public java.lang.Class asPrimitiveClass(java.lang.String name)
double,
int, etc.) corresponding the specified
string of the form "double", etc.
public java.lang.Object convertPrimitive(java.lang.Object value,
java.lang.Class target)
public java.lang.Object source(java.lang.Object o)
throws java.lang.Throwable
public java.lang.Object source(java.io.File f)
throws java.lang.Throwable
public java.lang.Object source(java.net.URL u)
throws java.lang.Throwable
public java.lang.Object source(java.lang.String src)
throws java.lang.Throwable
public java.io.PrintWriter stderr()
public java.io.PrintWriter stdout()
public int addFunctionTable(java.lang.Object source)
source - a regular Object or a Class whose static methods
are available.public boolean removeFunctionTable(java.lang.Object o)
public OrderedTable functionTableList()
public boolean allowUnrestrictedAccess()
MethodCall
to change the permission when invoking methods.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||