org.omegahat.Environment.Language.UserClasses
Class MethodsCollection
java.lang.Object
|
+--org.omegahat.Environment.Databases.ObjectDatabase
|
+--org.omegahat.Environment.Databases.ReadWriteDatabase
|
+--org.omegahat.Environment.Language.UserClasses.MethodsCollection
- All Implemented Interfaces:
- Activable, Database, DatabaseNotifier, DynamicFieldAccessInt, MergableInt, Named, ReadWriteDatabaseInt, java.io.Serializable, Subsettable
- Direct Known Subclasses:
- AbstractUserClass
- public class MethodsCollection
- extends ReadWriteDatabase
Used to store one or more Method
objects, indexed by the name of all the methods (interpreted functions) stored in each entry.
This is used when defining a class which maintains collections of functions
which act like \Java{} methods, supporting overloading.
- See Also:
- Serialized Form
|
Field Summary |
protected Evaluator |
evaluator
The default evaluator to use when evaluating a function within
one of the Method
unless another is specified in the call. |
| Methods inherited from class org.omegahat.Environment.Databases.ObjectDatabase |
addAssignListener, addAttachListener, addDetachListener, addListener, addRemoveListener, assign, attach, clear, detach, exists, get, getDynamicField, getName, getState, getTable, merge, merge, notify, objects, put, readOnly, readOnly, readSerialized, readSerialized, readSerialized, remove, setDynamicField, setName, setState, setTable, size, subset, table, table |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
evaluator
protected transient Evaluator evaluator
- The default evaluator to use when evaluating a function within
one of the
Method
unless another is specified in the call.
MethodsCollection
public MethodsCollection()
MethodsCollection
public MethodsCollection(int size)
- Initialize the table, allocating space for
size
objects.
MethodsCollection
public MethodsCollection(java.lang.String name)
- Create the database, giving it a name.
- Parameters:
name - Name of the database.
dispatchAndEval
public java.lang.Object dispatchAndEval(java.lang.String name,
java.lang.String sig,
FunctionCallArguments args,
java.lang.Object This)
throws java.lang.Throwable
dispatchAndEval
public java.lang.Object dispatchAndEval(java.lang.String name,
java.lang.String sig,
FunctionCallArguments args,
java.lang.Object This,
Evaluator evaluator)
throws java.lang.Throwable
- This version allows one to pass in a different
Evaluator
from the default one stored by this collection of methods.
- Parameters:
This - Java object instance whose method is being invoked.
evaluator
public Evaluator evaluator()
throws java.lang.ClassNotFoundException
- Access for the
evaluator field, returning a default evaluator
stored in Globals
if none has been specified for this objects.
evaluator
public Evaluator evaluator(Evaluator e)
throws java.lang.ClassNotFoundException
- Accessor to specify a default evaluator to be used when evaluating a function contained
within an element of this database.