net.sourceforge.webcompmath.functions.beans
Class WCMTableFunctionBean

java.lang.Object
  extended by net.sourceforge.webcompmath.functions.FunctionParserExtension
      extended by net.sourceforge.webcompmath.functions.TableFunction
          extended by net.sourceforge.webcompmath.functions.beans.WCMTableFunctionBean
All Implemented Interfaces:
java.io.Serializable, ParserMathObject, ExpressionCommand, Function, MathObject, ParserExtension

public class WCMTableFunctionBean
extends TableFunction
implements ParserMathObject

This bean implements a TableFunction. It supports only the addIntervals method of adding points, via bean properties. If you wish to add explicit points other than via intervals, you should call removeAllPoints() and then add points directly via method calls to TableFunction.

Author:
Tom Downey
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.webcompmath.functions.TableFunction
PIECEWISE_LINEAR, SMOOTH, STEP, STEP_LEFT, STEP_RIGHT
 
Fields inherited from class net.sourceforge.webcompmath.functions.FunctionParserExtension
name
 
Constructor Summary
WCMTableFunctionBean()
          Default constructor
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Just pass through to the support class
 int getIntervals()
          Get the number of intervals.
 MathObject getMathObject()
          Since this is a ParserExtension, just returns itself.
 java.lang.String getName()
          Get the name.
 int getStyle()
          Get the style.
 double getXmax()
          Get the maximum x value.
 double getXmin()
          Get the minimum x value.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          just pass through to the support class )
 void setIntervals(int intervals)
          Set the number of intervals.
 void setName(java.lang.String name)
          Fire a property change event if the name changes.
 void setStyle(int style)
          Set the style.
 void setXmax(double xmax)
          Set the maximum x value.
 void setXmin(double xmin)
          Set the minimum x value.
 
Methods inherited from class net.sourceforge.webcompmath.functions.TableFunction
addIntervals, addPoint, addPoints, apply, copyDataFrom, dependsOn, derivative, derivative, findPoint, getArity, getPointCount, getVal, getVal, getValueWithCases, getX, getY, removeAllPoints, removePointAt, setY
 
Methods inherited from class net.sourceforge.webcompmath.functions.FunctionParserExtension
appendOutputString, compileDerivative, doParse, extent, setParensCanBeOptional
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WCMTableFunctionBean

public WCMTableFunctionBean()
Default constructor

Method Detail

getStyle

public int getStyle()
Get the style.

Overrides:
getStyle in class TableFunction
Returns:
The style of this TableFunction. This is one of the constants SMOOTH, PIECEWISE_LINEAR, STEP, STEP_LEFT, or STEP_RIGHT.
See Also:
TableFunction.getStyle()

setStyle

public void setStyle(int style)
Set the style.

Overrides:
setStyle in class TableFunction
Parameters:
style - One of the style constants SMOOTH, PIECEWISE_LINEAR, STEP, STEP_LEFT, STEP_RIGHT. Other values are ignored.
See Also:
TableFunction.setStyle(int)

getIntervals

public int getIntervals()
Get the number of intervals.

Returns:
Returns the intervals.

setIntervals

public void setIntervals(int intervals)
Set the number of intervals.

Parameters:
intervals - The number of intervals.

getXmax

public double getXmax()
Get the maximum x value.

Returns:
Returns the xmax.

setXmax

public void setXmax(double xmax)
Set the maximum x value.

Parameters:
xmax - The max. value.

getXmin

public double getXmin()
Get the minimum x value.

Returns:
Returns the xmin.

setXmin

public void setXmin(double xmin)
Set the minimum x value.

Parameters:
xmin - The minimum value.

getName

public java.lang.String getName()
Get the name.

Specified by:
getName in interface MathObject
Overrides:
getName in class FunctionParserExtension
Returns:
name of the object
See Also:
FunctionParserExtension.getName()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Just pass through to the support class

Specified by:
addPropertyChangeListener in interface ParserMathObject
See Also:
ParserMathObject.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
just pass through to the support class )

Specified by:
removePropertyChangeListener in interface ParserMathObject
See Also:
ParserMathObject.removePropertyChangeListener(java.beans.PropertyChangeListener)

setName

public void setName(java.lang.String name)
Fire a property change event if the name changes.

Specified by:
setName in interface MathObject
Overrides:
setName in class FunctionParserExtension
Parameters:
name - name of the object
See Also:
FunctionParserExtension.setName(java.lang.String)

getMathObject

public MathObject getMathObject()
Since this is a ParserExtension, just returns itself.

Specified by:
getMathObject in interface ParserMathObject
Returns:
the MathObject that will be added to a parser
See Also:
ParserMathObject.getMathObject()