Skip navigation links
xal.tools.text

Class FortranNumberFormat

    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.text.NumberFormat

        java.text.NumberFormat.Field
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected static java.text.DecimalFormat[] scientificFormats
      The scientific formats
      protected static java.text.DecimalFormat[] simpleFormats
      The simple formats
      • Fields inherited from class java.text.NumberFormat

        FRACTION_FIELD, INTEGER_FIELD
    • Constructor Summary

      Constructors 
      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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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
      • Methods inherited from class java.text.DecimalFormat

        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
      • Methods inherited from class java.text.NumberFormat

        format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setParseIntegerOnly
      • Methods inherited from class java.text.Format

        format, parseObject
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • simpleFormats

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

        protected static java.text.DecimalFormat[] scientificFormats
        The scientific formats
    • Constructor Detail

      • FortranNumberFormat

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

        public FortranNumberFormat(java.lang.String pattern)
        Constructor for the FortranNumberFormat objectwith a formatting pattern as parameter
        Parameters:
        pattern - The formatting pattern
      • FortranNumberFormat

        public FortranNumberFormat(java.lang.String pattern,
                                   boolean fixedLength)
        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)
        Constructor for the FortranNumberFormat object with G10.3 formatting pattern and the fixed length property as parameter
        Parameters:
        fixedLength - The fixed length property
    • Method Detail

      • toPattern

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

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

        public void applyPattern(java.lang.String pattern)
        Applys the format pattern
        Overrides:
        applyPattern in class java.text.DecimalFormat
        Parameters:
        pattern - The format pattern
      • setFixedLength

        public void setFixedLength(boolean fixedLength)
        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(java.lang.String pattern)
        Applys the format pattern
        Overrides:
        applyLocalizedPattern in class java.text.DecimalFormat
        Parameters:
        pattern - The format pattern
      • getSignificantN

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

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

        public 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
        Overrides:
        format in class java.text.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 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
        Overrides:
        format in class java.text.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(java.lang.String[] args)
        The main method of the class. It is used for testing
        Parameters:
        args - The command line arguments