|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object extended byptolemy.data.Token extended byptolemy.data.FunctionToken
A token that contains a function. The function takes a fixed number of arguments, supplied as a list of tokens. Currently, no operations between function tokens (add, multiply, etc.) are supported.
| Field Summary |
| Fields inherited from class ptolemy.data.Token |
NIL |
| Constructor Summary | |
FunctionToken(Function f,
FunctionType type)
Create a new FunctionToken that applies the given function. |
|
FunctionToken(java.lang.String init)
Create a new FunctionToken from the given string. |
|
| Method Summary | |
Token |
apply(Token[] args)
Apply this function to the given list of arguments. |
int |
getNumberOfArguments()
Return the number of arguments of the function. |
Type |
getType()
Return the type of this token. |
BooleanToken |
isCloseTo(Token rightArgument,
double epsilon)
Test for closeness of the values of this Token and the argument Token. |
BooleanToken |
isEqualTo(Token rightArgument)
Test for equality of the values of this Token and the argument Token. |
java.lang.String |
toString()
Return a String representation of this function. |
| Methods inherited from class ptolemy.data.Token |
add, addReverse, divide, divideReverse, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FunctionToken(java.lang.String init) throws IllegalActionException
init - The initialization string, for example
function(x,y) 4+x+y.
IllegalActionException - If an error occurs, or the
string cannot be parsed into a function.public FunctionToken(Function f, FunctionType type)
f - The function.type - The function type.| Method Detail |
public Token apply(Token[] args) throws IllegalActionException
args - the arguments to which the function is applied
IllegalActionException - If the arguments are not
compatible with this function, or an error occurs during
evaluation.public int getNumberOfArguments()
public Type getType()
public BooleanToken isCloseTo(Token rightArgument, double epsilon)
rightArgument - The token to compare to this token.epsilon - This argument is ignored in this method.
public BooleanToken isEqualTo(Token rightArgument)
rightArgument - The token to compare to this token.
public java.lang.String toString()
Token.NIL,
in which case return the String "nil".
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||