All Packages Class Hierarchy This Package Previous Next Index
Class dpscomponents.RoundedDouble
java.lang.Object
|
+----dpscomponents.RoundedDouble
- public class RoundedDouble
- extends Object
This class just puts a little more framework around the number
formatting apparatus developed for use with sliders. Add a few
bells and whistles...
- Version:
- $Revision: 1.1.1.1 $, $Date: 1999/11/15 20:37:48 $.
- Author:
- Daren Stotler
- See Also:
- RoundedDoubleTest
-
RoundedDouble(double)
- Simplest constructor.
-
RoundedDouble(double, int)
- Complete constructor.
-
setPrecision(int)
- Allows the precision of the floating point number to be altered.
-
toDouble()
- The nicely formatted string of previously specified precision is
returned as a double.
-
toString()
- The principal reason for the existence of this class is to generate
nicely formatted fixed point numbers.
RoundedDouble
public RoundedDouble(double x)
- Simplest constructor.
- Parameters:
- x - double which will be rounded.
RoundedDouble
public RoundedDouble(double x,
int n)
- Complete constructor.
- Parameters:
- x - double which will be rounded.
- n - number of digits to the right of the decimal.
toString
public String toString()
- The principal reason for the existence of this class is to generate
nicely formatted fixed point numbers. This method provides the string
that's needed.
- Returns:
- string corresponding to the rounded double.
- Overrides:
- toString in class Object
setPrecision
public void setPrecision(int p)
- Allows the precision of the floating point number to be altered. Since
the original double value is not changed, this can be increased or
decreased as needed.
- Parameters:
- p - number of digits to the right of the decimal.
toDouble
public double toDouble()
- The nicely formatted string of previously specified precision is
returned as a double.
- Returns:
- double rounded off to a specified precision.
All Packages Class Hierarchy This Package Previous Next Index