|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgenopt.lang.ScientificFormat
public class ScientificFormat
Object for parsing numbers to scientific format.
This project was carried out at:
and supported byGenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.
| Field Summary | |
|---|---|
private int |
dig
the number of digits following the decimal point |
private static int |
expWidth
the exponent width (including sign, excluding E) |
private int |
fieWidth
the field width |
private static double |
LG_10
the natural logarithm (base e) of 10 |
private double |
num
the number |
| Constructor Summary | |
|---|---|
ScientificFormat(double number,
int fieldWidth,
int digits)
constructor |
|
| Method Summary | |
|---|---|
double |
doubleValue()
gets the double representation of the Object |
int |
getDigits()
gets the number of digits following the decimal point |
int |
getFieldWidth()
gets the width of the field (including minus sign, excluding E) |
static void |
main(java.lang.String[] args)
|
protected java.lang.String |
parseToString()
parses the the Object to a String |
void |
setDigits(int n)
sets the number of digits following the decimal point |
void |
setFieldWidth(int n)
sets the width of the field (including minus sign, excluding E) |
java.lang.String |
toString()
gets the String representation of the Object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private double num
private int fieWidth
private int dig
private static int expWidth
E)
private static double LG_10
| Constructor Detail |
|---|
public ScientificFormat(double number,
int fieldWidth,
int digits)
number - the number to be parsedfieldWidth - the width of the fielddigits - the number of digits following the decimal point| Method Detail |
|---|
public void setDigits(int n)
n - the number of digits following the decimal pointpublic int getDigits()
public void setFieldWidth(int n)
E)
n - the width of the fieldpublic int getFieldWidth()
E)
public double doubleValue()
double representation of the Object
double representation of the Objectpublic java.lang.String toString()
String representation of the Object
toString in class java.lang.ObjectString representation of the Objectprotected java.lang.String parseToString()
String
String representation of the Objectpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||