Class FortranNumberFormat

All Implemented Interfaces:
Serializable, Cloneable

@Deprecated public class FortranNumberFormat extends DecimalFormat
Deprecated.
due to compatibility problems with Java 8. The advertised formatting is not satisfied under Java 8. Use ScientificNumberFormat instead. This class is around temporarily for backward compatibility but will be removed in the near future. FortranNumberFormat is the subclass of the DecimalFormat class. It formats the double numbers and integers according to GN.F format specification in the FORTRAN programming language. Usually N = F + 7, because an exponential representation needs additional symbols for signs of the value and the power of ten, E symbol, a decimal point, and the value of power. For instance, -1.23E-101. If user will choose N < F + 7 the formatting still will work, but the length of the resulting string may be more that N. The property fixedLength can be used to fill out the resulting string with leading spaces. This property can be set with setFixedLength method or by using a proper constructor
Version:
1.0
Author:
shishlo
See Also:
  • Field Details

    • simpleFormats

      protected static DecimalFormat[] simpleFormats
      Deprecated.
      The simple formats
    • scientificFormats

      protected static DecimalFormat[] scientificFormats
      Deprecated.
      The scientific formats
  • Constructor Details

    • FortranNumberFormat

      public FortranNumberFormat()
      Deprecated.
      Constructor with a default format pattern G10.3
    • FortranNumberFormat

      public FortranNumberFormat(String pattern)
      Deprecated.
      Constructor for the FortranNumberFormat object with a formatting pattern as parameter
      Parameters:
      pattern - The formatting pattern
    • FortranNumberFormat

      public FortranNumberFormat(String pattern, boolean fixedLength)
      Deprecated.
      Constructor for the FortranNumberFormat object with a formatting pattern and the fixed length property as parameters
      Parameters:
      pattern - The formatting pattern
      fixedLength - The fixed length property
    • FortranNumberFormat

      public FortranNumberFormat(boolean fixedLength)
      Deprecated.
      Constructor for the FortranNumberFormat object with G10.3 formatting pattern and the fixed length property as parameter
      Parameters:
      fixedLength - The fixed length property
  • Method Details

    • toPattern

      public String toPattern()
      Deprecated.
      Returns the formatting pattern
      Overrides:
      toPattern in class DecimalFormat
      Returns:
      The formatting pattern
    • toLocalizedPattern

      public String toLocalizedPattern()
      Deprecated.
      Returns the formatting pattern
      Overrides:
      toLocalizedPattern in class DecimalFormat
      Returns:
      The formatting pattern
    • applyPattern

      public void applyPattern(String pattern)
      Deprecated.
      Applies the format pattern
      Overrides:
      applyPattern in class DecimalFormat
      Parameters:
      pattern - The format pattern
    • setFixedLength

      public void setFixedLength(boolean fixedLength)
      Deprecated.
      Sets the fixedLength attribute of the FortranNumberFormat object. If it is true the resulting string will be filled out with right spaces
      Parameters:
      fixedLength - True or false
    • applyLocalizedPattern

      public void applyLocalizedPattern(String pattern)
      Deprecated.
      Applies the format pattern
      Overrides:
      applyLocalizedPattern in class DecimalFormat
      Parameters:
      pattern - The format pattern
    • getSignificantN

      public int getSignificantN()
      Deprecated.
      Returns the number of significant digits for this format
      Returns:
      The number of significant digits for this format
    • getStringLength

      public int getStringLength()
      Deprecated.
      Returns the maximal length of the formatted number
      Returns:
      The maximal length of the formatted number
    • format

      public StringBuffer format(double val, StringBuffer toAppendTo, FieldPosition pos)
      Deprecated.
      The overridden method of the DecimalFormat that delegates formatting to the specific inner formatter
      Overrides:
      format in class DecimalFormat
      Parameters:
      val - The double value to be formatted
      toAppendTo - Where the text is to be appended
      pos - On input: an alignment field, if desired. On output: the offsets of the alignment field
      Returns:
      The text that will be displayed
    • format

      public StringBuffer format(long val, StringBuffer toAppendTo, FieldPosition pos)
      Deprecated.
      The overridden method of the DecimalFormat that delegates formatting to the specific inner formatter
      Overrides:
      format in class DecimalFormat
      Parameters:
      val - The integer value to be formatted
      toAppendTo - Where the text is to be appended
      pos - On input: an alignment field, if desired. On output: the offsets of the alignment field
      Returns:
      The text that will be displayed
    • main

      public static void main(String[] args)
      Deprecated.
      The main method of the class. It is used for testing
      Parameters:
      args - The command line arguments