tracer.expression
Class Function

java.lang.Object
  |
  +--tracer.expression.Function
Direct Known Subclasses:
oneArgFunction, twoArgFunction

public abstract class Function
extends java.lang.Object

Abstract class type for functions. Each function needs to specify the number of arguments in its variable list. The Function prototype can take at most two arguments. Functions with more arguments can be represented by multiple function pairs.


Field Summary
 int numArgs
          Number of arguments the function can take
 
Constructor Summary
Function()
           
 
Method Summary
abstract  double apply(double a)
          Apply function to a single argument.
abstract  double apply(double a, double b)
          Apply function to two arguments.
abstract  java.lang.String toString()
          Return the string representation of the function.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numArgs

public int numArgs
Number of arguments the function can take
Constructor Detail

Function

public Function()
Method Detail

apply

public abstract double apply(double a)
Apply function to a single argument.

apply

public abstract double apply(double a,
                             double b)
Apply function to two arguments.

toString

public abstract java.lang.String toString()
Return the string representation of the function.
Overrides:
toString in class java.lang.Object