Record Class NumberFormatSymbols

java.lang.Object
java.lang.Record
ch.randelshofer.fastdoubleparser.NumberFormatSymbols
Record Components:
decimalSeparator - a set of decimal separator characters
groupingSeparator - a set of grouping characters
exponentSeparator - a set of exponent separator strings
minusSign - a set of minus sign characters
plusSign - a set of plus sign characters
infinity - a set of infinity strings
nan - a set of NaN strings
digits - the digit characters from 0 to 9

public record NumberFormatSymbols(Set<Character> decimalSeparator, Set<Character> groupingSeparator, Set<String> exponentSeparator, Set<Character> minusSign, Set<Character> plusSign, Set<String> infinity, Set<String> nan, List<Character> digits) extends Record
Defines a set of symbols for ConfigurableDoubleParser.
  • Constructor Details

    • NumberFormatSymbols

      public NumberFormatSymbols(Set<Character> decimalSeparator, Set<Character> groupingSeparator, Set<String> exponentSeparator, Set<Character> minusSign, Set<Character> plusSign, Set<String> infinity, Set<String> nan, List<Character> digits)
      Canonical constructor.
      Parameters:
      decimalSeparator - each character in this string defines a decimal separator
      groupingSeparator - each character in this string defines a decimal separator
      exponentSeparator - each string in this collection defines an exponent separator
      minusSign - each character in this string defines a minus sign
      plusSign - each character in this string defines a plus sign
      infinity - each string in this collection defines an infinity string
      nan - each string in this collection defines a NaN string
      digits - the first 10 characters in this string define the digit characters from 0 to 9
    • NumberFormatSymbols

      public NumberFormatSymbols(String decimalSeparators, String groupingSeparators, Collection<String> exponentSeparators, String minusSigns, String plusSigns, Collection<String> infinity, Collection<String> nan, String digits)
      Convenience constructor.
      Parameters:
      decimalSeparators - each character in this string defines a decimal separator
      groupingSeparators - each character in this string defines a decimal separator
      exponentSeparators - each string in this collection defines an exponent separator
      minusSigns - each character in this string defines a minus sign
      plusSigns - each character in this string defines a plus sign
      infinity - each string in this collection defines an infinity string
      nan - each string in this collection defines a NaN string
      digits - the first 10 characters in this string define the digit characters from 0 to 9
  • Method Details

    • fromDecimalFormatSymbols

      public static NumberFormatSymbols fromDecimalFormatSymbols(DecimalFormatSymbols symbols)
      Creates a new instance from the provided DecimalFormatSymbols.
      Parameters:
      symbols - the decimal format symbols
      Returns:
      a new instance
    • fromDefault

      public static NumberFormatSymbols fromDefault()
      Creates a new instance with the following default symbols.
      decimalSeparator
      .
      groupingSeparator
      none
      exponentSeparator
      e, E
      minusSign
      -
      plusSign
      +
      infinity
      Infinity
      nan
      NaN
      digits
      0 ... 9
      Returns:
      a new instance
    • withDecimalSeparator

      public NumberFormatSymbols withDecimalSeparator(Set<Character> newValue)
      Creates a new instance with the specified decimal separator symbols.
      Parameters:
      newValue - the decimal separator symbols
      Returns:
      a new instance
    • withDigits

      public NumberFormatSymbols withDigits(List<Character> newValue)
      Creates a new instance with the specified digits.
      Parameters:
      newValue - the digits
      Returns:
      a new instance
    • withExponentSeparator

      public NumberFormatSymbols withExponentSeparator(Set<String> newValue)
      Creates a new instance with the specified exponent separator symbols.
      Parameters:
      newValue - the exponent separator symbols
      Returns:
      a new instance
    • withGroupingSeparator

      public NumberFormatSymbols withGroupingSeparator(Set<Character> newValue)
      Creates a new instance with the specified grouping separator symbols.
      Parameters:
      newValue - the grouping separator symbols
      Returns:
      a new instance
    • withInfinity

      public NumberFormatSymbols withInfinity(Set<String> newValue)
      Creates a new instance with the specified infinity symbols.
      Parameters:
      newValue - the infinity symbols
      Returns:
      a new instance
    • withMinusSign

      public NumberFormatSymbols withMinusSign(Set<Character> newValue)
      Creates a new instance with the specified minus sign symbols.
      Parameters:
      newValue - the minus sign symbols
      Returns:
      a new instance
    • withNaN

      public NumberFormatSymbols withNaN(Set<String> newValue)
      Creates a new instance with the specified NaN symbols.
      Parameters:
      newValue - the NaN symbols
      Returns:
      a new instance
    • withPlusSign

      public NumberFormatSymbols withPlusSign(Set<Character> newValue)
      Creates a new instance with the specified plus sign symbols.
      Parameters:
      newValue - the plus sign symbols
      Returns:
      a new instance
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • decimalSeparator

      public Set<Character> decimalSeparator()
      Returns the value of the decimalSeparator record component.
      Returns:
      the value of the decimalSeparator record component
    • groupingSeparator

      public Set<Character> groupingSeparator()
      Returns the value of the groupingSeparator record component.
      Returns:
      the value of the groupingSeparator record component
    • exponentSeparator

      public Set<String> exponentSeparator()
      Returns the value of the exponentSeparator record component.
      Returns:
      the value of the exponentSeparator record component
    • minusSign

      public Set<Character> minusSign()
      Returns the value of the minusSign record component.
      Returns:
      the value of the minusSign record component
    • plusSign

      public Set<Character> plusSign()
      Returns the value of the plusSign record component.
      Returns:
      the value of the plusSign record component
    • infinity

      public Set<String> infinity()
      Returns the value of the infinity record component.
      Returns:
      the value of the infinity record component
    • nan

      public Set<String> nan()
      Returns the value of the nan record component.
      Returns:
      the value of the nan record component
    • digits

      public List<Character> digits()
      Returns the value of the digits record component.
      Returns:
      the value of the digits record component