public class FortranNumberFormat
extends java.text.DecimalFormat
setFixedLength
method or by using a proper constructor
Modifier and Type | Field and Description |
---|---|
protected static java.text.DecimalFormat[] |
scientificFormats
The scientific formats
|
protected static java.text.DecimalFormat[] |
simpleFormats
The simple formats
|
Constructor and Description |
---|
FortranNumberFormat()
Constructor with a default format pattern G10.3
|
FortranNumberFormat(boolean fixedLength)
Constructor for the FortranNumberFormat object with G10.3 formatting
pattern and the fixed length property as parameter
|
FortranNumberFormat(java.lang.String pattern)
Constructor for the FortranNumberFormat objectwith a formatting pattern
as parameter
|
FortranNumberFormat(java.lang.String pattern,
boolean fixedLength)
Constructor for the FortranNumberFormat object with a formatting pattern
and the fixed length property as parameters
|
Modifier and Type | Method and Description |
---|---|
void |
applyLocalizedPattern(java.lang.String pattern)
Applys the format pattern
|
void |
applyPattern(java.lang.String pattern)
Applys the format pattern
|
java.lang.StringBuffer |
format(double val,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
The overridden method of the DecimalFormat that delegates formatting to
the specific inner formatter
|
java.lang.StringBuffer |
format(long val,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
The overridden method of the DecimalFormat that delegates formatting to
the specific inner formatter
|
int |
getSignificantN()
Returns the number of significant digits for this format
|
int |
getStringLength()
Returns the maximal length of the formatted number
|
static void |
main(java.lang.String[] args)
The main method of the class.
|
void |
setFixedLength(boolean fixedLength)
Sets the fixedLength attribute of the FortranNumberFormat object.
|
java.lang.String |
toLocalizedPattern()
Returns the formatting pattern
|
java.lang.String |
toPattern()
Returns the formatting pattern
|
clone, equals, format, formatToCharacterIterator, getCurrency, getDecimalFormatSymbols, getGroupingSize, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getMultiplier, getNegativePrefix, getNegativeSuffix, getPositivePrefix, getPositiveSuffix, getRoundingMode, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, setRoundingMode
format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setParseIntegerOnly
protected static java.text.DecimalFormat[] simpleFormats
protected static java.text.DecimalFormat[] scientificFormats
public FortranNumberFormat()
public FortranNumberFormat(java.lang.String pattern)
pattern
- The formatting patternpublic FortranNumberFormat(java.lang.String pattern, boolean fixedLength)
pattern
- The formatting patternfixedLength
- The fixed length propertypublic FortranNumberFormat(boolean fixedLength)
fixedLength
- The fixed length propertypublic java.lang.String toPattern()
toPattern
in class java.text.DecimalFormat
public java.lang.String toLocalizedPattern()
toLocalizedPattern
in class java.text.DecimalFormat
public void applyPattern(java.lang.String pattern)
applyPattern
in class java.text.DecimalFormat
pattern
- The format patternpublic void setFixedLength(boolean fixedLength)
fixedLength
- True or falsepublic void applyLocalizedPattern(java.lang.String pattern)
applyLocalizedPattern
in class java.text.DecimalFormat
pattern
- The format patternpublic int getSignificantN()
public int getStringLength()
public java.lang.StringBuffer format(double val, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.DecimalFormat
val
- The double value to be formattedtoAppendTo
- Where the text is to be appendedpos
- On input: an alignment field, if desired. On output:
the offsets of the alignment fieldpublic java.lang.StringBuffer format(long val, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.DecimalFormat
val
- The integer value to be formattedtoAppendTo
- Where the text is to be appendedpos
- On input: an alignment field, if desired. On output:
the offsets of the alignment fieldpublic static void main(java.lang.String[] args)
args
- The command line arguments