|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.expr.ExpressionFunction
public class ExpressionFunction
An implementation of a function closure that encapsulates an expression tree. Instances of this class are created during the evaluation of function closure expressions in the expression language, like "function(x:int, y:int) x+y".
ASTPtRootNode
Red (neuendor) |
Yellow (neuendor) |
Field Summary | |
---|---|
private java.util.List |
_argumentNames
|
private Type[] |
_argumentTypes
|
private ASTPtRootNode |
_exprRoot
|
Constructor Summary | |
---|---|
ExpressionFunction(java.util.List argumentNames,
Type[] argumentTypes,
ASTPtRootNode exprRoot)
Construct a function closure that encapsulates an expression tree. |
Method Summary | |
---|---|
Token |
apply(Token[] arguments)
Apply the function to the list of arguments, which are tokens. |
int |
getNumberOfArguments()
Return the number of arguments of the function. |
boolean |
isCongruent(Function function)
Return true if this function is congruent to the given function. |
java.lang.String |
toString()
Return a string representation of this function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ASTPtRootNode _exprRoot
private java.util.List _argumentNames
private Type[] _argumentTypes
Constructor Detail |
---|
public ExpressionFunction(java.util.List argumentNames, Type[] argumentTypes, ASTPtRootNode exprRoot)
argumentNames
- The names of the arguments.argumentTypes
- The types of the arguments.exprRoot
- The Expression tree that describes the function.Method Detail |
---|
public Token apply(Token[] arguments) throws IllegalActionException
apply
in interface Function
arguments
- The list of arguments.
IllegalActionException
- If thrown during evaluating
the function.public int getNumberOfArguments()
getNumberOfArguments
in interface Function
public boolean isCongruent(Function function)
isCongruent
in interface Function
function
- The function to check congruency against.
public java.lang.String toString()
toString
in interface Function
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |