ptolemy.data
Interface Function

All Known Implementing Classes:
ExpressionFunction, PtCalFunction

public interface Function

The interface for functions contained by function tokens.

Since:
Ptolemy II 4.0
Version:
$Id: Function.java 47513 2007-12-07 06:32:21Z cxh $
Author:
Xiaojun Liu, Steve Neuendorffer
Accepted Rating:
Red (liuxj)
Proposed Rating:
Yellow (liuxj)

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.
 

Method Detail

apply

Token apply(Token[] arguments)
            throws IllegalActionException
Apply the function to the list of arguments, which are tokens.

Parameters:
arguments - The list of arguments.
Returns:
The result of applying the function to the given arguments.
Throws:
IllegalActionException - If thrown during evaluating the function.

getNumberOfArguments

int getNumberOfArguments()
Return the number of arguments of the function.

Returns:
The number of arguments of the function.

isCongruent

boolean isCongruent(Function function)
Return true if this function is congruent to the given function. Classes should implement this method so that two functions are congruent under any renaming of the bound variables of the function. For simplicity, a function need only be congruent to other functions of the same class.

Parameters:
function - The function to check congruency against.
Returns:
True if this function is congruent with the given function.

toString

java.lang.String toString()
Return a string representation.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this function.