|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Environment.GUITools.OmegaListener
|
+--org.omegahat.Environment.GUITools.FunctionListener
Base class extended by dynamically created classes used to implement a Java
interface with an interpreted Function.
This provides the basic methods for instantiating such an object, storing the function
and Evaluator
and utility methods for processing the arguments to a Java method
to a form suitable for a function call.
Note that this class is potentially
non thread-safe if one uses the arguments
field. The automatically generated byte code does not use this
anymore.
| Field Summary | |
protected List |
arguments
Collection to which arguments to a Java method are added one at a time before being passed to the Function
when it is evaluated as part of the method's body. |
| Fields inherited from class org.omegahat.Environment.GUITools.OmegaListener |
callback, evaluator |
| Constructor Summary | |
FunctionListener()
Degenerate constructor that allows the specification of the function and evaluator at a later time. |
|
FunctionListener(double d,
int[][] x,
java.util.Vector v)
Dummy constructor used only in testing inheritance of constructors! |
|
FunctionListener(Function f)
Constructor specifying the Function
that is to be invoked in response to each method. |
|
FunctionListener(Function f,
Evaluator eval)
Constructor specifying the Function
that is to be invoked in response to each method and the
The Evaluator
which is to be used for the evaluation of the function call. |
|
| Method Summary | |
void |
addArgument(boolean b)
Convert a boolean to an Object
(Boolean)
and add it to the arguments collection. |
void |
addArgument(byte b)
Convert a byte to an Object
(Byte)
and add it to the arguments collection. |
void |
addArgument(char c)
Convert a char to an Object
and add it to the arguments collection. |
void |
addArgument(double d)
Convert a double to an Object
(Double)
and add it to the arguments collection. |
void |
addArgument(float f)
Convert a float to an Object
(Float)
and add it to the arguments collection. |
void |
addArgument(int i)
Convert an int to an Object
(Integer)
and add it to the arguments collection. |
void |
addArgument(long l)
Convert a long to an Object
(Long)
and add it to the arguments collection. |
void |
addArgument(java.lang.Object o)
|
void |
addArgument(short s)
Convert a short to an Object
(Short)
and add it to the arguments collection. |
List |
arguments()
Accessor to the value for the arguments field. |
List |
arguments(List l)
Accessor to specify the value for the arguments field. |
java.lang.Object |
eval()
Evaluate the function call using the current value of the arguments field
as the arguments to the function. |
java.lang.Object |
eval(List l)
Evaluate the function contained in this object with the elements of the specified List
as arguments to the function. |
| Methods inherited from class org.omegahat.Environment.GUITools.OmegaListener |
callback, callback, evaluator, evaluator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected List arguments
Function
when it is evaluated as part of the method's body.
Using this makes the class non-thread safe.
The new code in EvaluableInterfaceGenerator
now takes care of using an instance of
FunctionCallArguments
list that is local to the method and passed to the
eval(List)
method
| Constructor Detail |
public FunctionListener(Function f)
Function
that is to be invoked in response to each method.
The Evaluator is determined
when needed.
public FunctionListener(Function f,
Evaluator eval)
Function
that is to be invoked in response to each method and the
The Evaluator
which is to be used for the evaluation of the function call.public FunctionListener()
public FunctionListener(double d,
int[][] x,
java.util.Vector v)
| Method Detail |
public List arguments()
arguments field.public List arguments(List l)
arguments field.public void addArgument(java.lang.Object o)
public void addArgument(int i)
int to an Object
(Integer)
and add it to the arguments collection.public void addArgument(short s)
short to an Object
(Short)
and add it to the arguments collection.public void addArgument(double d)
double to an Object
(Double)
and add it to the arguments collection.public void addArgument(long l)
long to an Object
(Long)
and add it to the arguments collection.public void addArgument(byte b)
byte to an Object
(Byte)
and add it to the arguments collection.public void addArgument(char c)
char to an Object
and add it to the arguments collection.public void addArgument(boolean b)
boolean to an Object
(Boolean)
and add it to the arguments collection.public void addArgument(float f)
float to an Object
(Float)
and add it to the arguments collection.public java.lang.Object eval()
arguments field
as the arguments to the function.eval in class OmegaListenerpublic java.lang.Object eval(List l)
List
as arguments to the function.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||