Package ptolemy.data

Interface Function

  • All Known Implementing Classes:
    ExpressionFunction, FactorOracle.ChordFunction, PtCalFunction

    public interface Function
    The interface for functions contained by function tokens.
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Xiaojun Liu, Steve Neuendorffer
    Pt.AcceptedRating:
    Red (liuxj)
    Pt.ProposedRating:
    Yellow (liuxj)
    • 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.