|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.data.Token
ptolemy.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.
| Red (liuxj) |
| Yellow (liuxj) |
| 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, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, 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
IllegalActionException - If an error occurs, or the
string cannot be parsed into a function.
public FunctionToken(Function f,
FunctionType type)
| Method Detail |
public Token apply(Token[] args)
throws IllegalActionException
IllegalActionException - If the arguments are not
compatible with this function, or an error occurs during
evaluation.public int getNumberOfArguments()
public Type getType()
getType in class Token
public BooleanToken isCloseTo(Token rightArgument,
double epsilon)
throws IllegalActionException
isCloseTo in class TokenrightArgument - The token to compare to this token.epsilon - This argument is ignored in this method.
IllegalActionException - If the argument token is not
of a type that can be compared with this token.public BooleanToken isEqualTo(Token rightArgument)
isEqualTo in class TokenrightArgument - The token to compare to this token.
public java.lang.String toString()
toString in class Token
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||