All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.awt.Format

java.lang.Object
   |
   +----crw.awt.Format

public class Format
extends Object
Class to make double-value numbers suitable for display on screen. Public methods of form formX(double v) are to format an arbitrary double-value numbers into the form X. For example, the method formE() turns the number into a scientific format.

Version:
1.0 2-14-1998
Author:
C.R.Wie

Constructor Index

 o Format()
Default constructor with 3 significant digits, 1.0 as common factor, and 0 as exponent.
 o Format(double)
Constructor sets the common factor.
 o Format(int)
Constructor sets the number of significant digits.
 o Format(int, double)
Constructor sets the number of significant digits for the mentissa, and the common factor to be multiplied to all values which will be formatted with this Format object.

Method Index

 o formE(double)
Returns a String object corresponding to the double value after formatting.
 o formE(double, int)
Changes the number of significant digits and does the same as formE(double).
 o formE(Vector)
Accepts a vector of Double objects and replaces each element, a Double object, by the String equivalent of the doule values after formatting.
 o setSigDigits(int)
Sets a new number of significant digits.

Constructors

 o Format
 public Format()
Default constructor with 3 significant digits, 1.0 as common factor, and 0 as exponent.

 o Format
 public Format(int sigDigit)
Constructor sets the number of significant digits.

Parameters:
sigDigit - the number of significant digits.
 o Format
 public Format(double common)
Constructor sets the common factor. The common factor is multiplied to all double values before formatting.

 o Format
 public Format(int sigDigit,
               double common)
Constructor sets the number of significant digits for the mentissa, and the common factor to be multiplied to all values which will be formatted with this Format object.

Methods

 o setSigDigits
 public void setSigDigits(int sigDigits)
Sets a new number of significant digits.

Parameters:
sigDigits - the new number of significant digits.
 o formE
 public String formE(double val)
Returns a String object corresponding to the double value after formatting.

Parameters:
val - the double value to format.
Returns:
the String equivalent.
 o formE
 public String formE(double val,
                     int sigDigits)
Changes the number of significant digits and does the same as formE(double).

Parameters:
val - the double value to format.
sigDigits - the new number of sig digits.
Returns:
the String equivalent.
 o formE
 public Vector formE(Vector v) throws DataFormatException
Accepts a vector of Double objects and replaces each element, a Double object, by the String equivalent of the doule values after formatting.

Parameters:
v - the vector of double object. After this method
Returns:
the Vector v containes String objects.
Throws: DataFormatException
if object in vector is not an instance of Double.

All Packages  Class Hierarchy  This Package  Previous  Next  Index