uk.ac.ed.ph.signal
Class Function

java.lang.Object
  extended by uk.ac.ed.ph.signal.Function

public abstract class Function
extends Object

Abstarct class to implemet a real Function in one dimension. This class also implements toPlot function using ptplot.


Field Summary
protected  double maxPlotRange
          Upper range of plot
protected  double minPlotRange
          Lower range of plot
 
Constructor Summary
Function()
           
 
Method Summary
 ptolemy.plot.Plot getPlot()
          Method to get the Plot object.
 int getPlotPoints()
          Method to get the number of plotpoints
abstract  double getValue(double x)
          Method to get the value as specific value
 void setPlotPoints(int points)
          Method to set the number of point in a plot.
 void setPlotRange(double min, double max)
          Method to set the range of a plot.
 void toPlot(int ds)
          Method to plot the function to an internal Plot class.
 void toPlot(ptolemy.plot.Plot p, int ds)
          Void method to add a line to a ptplot Plot dataset using the default range.
 void toPlot(ptolemy.plot.Plot p, int ds, double minPlot, double maxPlot)
          Void method to add a line to a ptplot Plot dataset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minPlotRange

protected double minPlotRange
Lower range of plot


maxPlotRange

protected double maxPlotRange
Upper range of plot

Constructor Detail

Function

public Function()
Method Detail

getValue

public abstract double getValue(double x)
Method to get the value as specific value

Parameters:
x - the x value
Returns:
double value of the function.

setPlotPoints

public void setPlotPoints(int points)
Method to set the number of point in a plot.

Parameters:
points - number of points.

getPlotPoints

public int getPlotPoints()
Method to get the number of plotpoints

Returns:
int the number of points

getPlot

public ptolemy.plot.Plot getPlot()
Method to get the Plot object. This may be null if no graph has been asked for.


setPlotRange

public void setPlotRange(double min,
                         double max)
Method to set the range of a plot.

Parameters:
min - minimum range.
max - maximum range

toPlot

public void toPlot(int ds)
Method to plot the function to an internal Plot class. If this is the first plot, then the Plot object will be automaticall created.

Parameters:
ds - the data set

toPlot

public void toPlot(ptolemy.plot.Plot p,
                   int ds)
Void method to add a line to a ptplot Plot dataset using the default range.

Parameters:
p - the Plot to which it is added
ds - the dataset

toPlot

public void toPlot(ptolemy.plot.Plot p,
                   int ds,
                   double minPlot,
                   double maxPlot)
Void method to add a line to a ptplot Plot dataset

Parameters:
p - the Plot to which it is added
ds - the dataset to hold the spectrum
minPlot - minumum value on plot
maxPlot - maximum value on plot