GrapherGUI
Class Function

java.lang.Object
  |
  +--GrapherGUI.Function
Direct Known Subclasses:
NativeFunction

public abstract class Function
extends java.lang.Object

The Graph class maintains a list of Function objects which need to be plotted. The user must define the function which takes one independent value and a list of possible parameter values. This function then returns the dependent value. To see how to grab parameter values, check the SliderMatrix class.


Constructor Summary
Function()
           
 
Method Summary
 java.awt.Color color()
          Defines the default color of the function.
abstract  double f(double in, GrapherGUI.SliderMatrix p)
          A Graph object uses this user defined object to calculate the set of coordinates for a function.
abstract  java.lang.String name()
          The name of the function to be displayed in the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Function

public Function()
Method Detail

f

public abstract double f(double in,
                         GrapherGUI.SliderMatrix p)
A Graph object uses this user defined object to calculate the set of coordinates for a function.

Parameters:
in - a value of the independent variable
p - containing the parameter values.
Returns:
value of the dependent variable associated with the input
See Also:
SliderMatrix

color

public java.awt.Color color()
Defines the default color of the function. Should be overridden. If the subclass does not define this function, the color will default to blue.

Returns:
Color object

name

public abstract java.lang.String name()
The name of the function to be displayed in the key.

Returns:
a description of the function