org.opensourcephysics.controls
Class AbstractCalculation

java.lang.Object
  extended byorg.opensourcephysics.controls.AbstractCalculation
All Implemented Interfaces:
Calculation

public abstract class AbstractCalculation
extends java.lang.Object
implements Calculation

AbstractCalculation is a template for simple calculations. Implement the calculate method to create a calculation.


Field Summary
protected  Control control
           
protected  java.text.DecimalFormat decimalFormat
           
 
Constructor Summary
AbstractCalculation()
           
 
Method Summary
abstract  void calculate()
          Does the calculation.
 void reset()
          Resets the program to its default state.
 void resetCalculation()
          Resets the calculation to a predefined state.
 void setControl(Control control)
          Sets object that controls this calculation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

control

protected Control control

decimalFormat

protected java.text.DecimalFormat decimalFormat
Constructor Detail

AbstractCalculation

public AbstractCalculation()
Method Detail

setControl

public void setControl(Control control)
Sets object that controls this calculation. The calculation should use this method to register its parameters with the control. This insures that the control displays the program's parameters when it appears onscreen.

Specified by:
setControl in interface Calculation
Parameters:
control -

calculate

public abstract void calculate()
Does the calculation.

Specified by:
calculate in interface Calculation

resetCalculation

public void resetCalculation()
Resets the calculation to a predefined state.

Specified by:
resetCalculation in interface Calculation

reset

public void reset()
Resets the program to its default state. Override this method to set the program's parameters.