Record Class NumberFormatSymbols
java.lang.Object
java.lang.Record
ch.randelshofer.fastdoubleparser.NumberFormatSymbols
- Record Components:
decimalSeparator- a set of decimal separator charactersgroupingSeparator- a set of grouping charactersexponentSeparator- a set of exponent separator stringsminusSign- a set of minus sign charactersplusSign- a set of plus sign charactersinfinity- a set of infinity stringsnan- a set of NaN stringsdigits- 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 Summary
ConstructorsConstructorDescriptionNumberFormatSymbols(String decimalSeparators, String groupingSeparators, Collection<String> exponentSeparators, String minusSigns, String plusSigns, Collection<String> infinity, Collection<String> nan, String digits) Convenience constructor.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. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedecimalSeparatorrecord component.digits()Returns the value of thedigitsrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexponentSeparatorrecord component.static NumberFormatSymbolsCreates a new instance from the providedDecimalFormatSymbols.static NumberFormatSymbolsCreates a new instance with the following default symbols.Returns the value of thegroupingSeparatorrecord component.final inthashCode()Returns a hash code value for this object.infinity()Returns the value of theinfinityrecord component.Returns the value of theminusSignrecord component.nan()Returns the value of thenanrecord component.plusSign()Returns the value of theplusSignrecord component.final StringtoString()Returns a string representation of this record class.withDecimalSeparator(Set<Character> newValue) Creates a new instance with the specified decimal separator symbols.withDigits(List<Character> newValue) Creates a new instance with the specified digits.withExponentSeparator(Set<String> newValue) Creates a new instance with the specified exponent separator symbols.withGroupingSeparator(Set<Character> newValue) Creates a new instance with the specified grouping separator symbols.withInfinity(Set<String> newValue) Creates a new instance with the specified infinity symbols.withMinusSign(Set<Character> newValue) Creates a new instance with the specified minus sign symbols.Creates a new instance with the specified NaN symbols.withPlusSign(Set<Character> newValue) Creates a new instance with the specified plus sign symbols.
-
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 separatorgroupingSeparator- each character in this string defines a decimal separatorexponentSeparator- each string in this collection defines an exponent separatorminusSign- each character in this string defines a minus signplusSign- each character in this string defines a plus signinfinity- each string in this collection defines an infinity stringnan- each string in this collection defines a NaN stringdigits- 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 separatorgroupingSeparators- each character in this string defines a decimal separatorexponentSeparators- each string in this collection defines an exponent separatorminusSigns- each character in this string defines a minus signplusSigns- each character in this string defines a plus signinfinity- each string in this collection defines an infinity stringnan- each string in this collection defines a NaN stringdigits- the first 10 characters in this string define the digit characters from 0 to 9
-
-
Method Details
-
fromDecimalFormatSymbols
Creates a new instance from the providedDecimalFormatSymbols.- Parameters:
symbols- the decimal format symbols- Returns:
- a new instance
-
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
Creates a new instance with the specified decimal separator symbols.- Parameters:
newValue- the decimal separator symbols- Returns:
- a new instance
-
withDigits
Creates a new instance with the specified digits.- Parameters:
newValue- the digits- Returns:
- a new instance
-
withExponentSeparator
Creates a new instance with the specified exponent separator symbols.- Parameters:
newValue- the exponent separator symbols- Returns:
- a new instance
-
withGroupingSeparator
Creates a new instance with the specified grouping separator symbols.- Parameters:
newValue- the grouping separator symbols- Returns:
- a new instance
-
withInfinity
Creates a new instance with the specified infinity symbols.- Parameters:
newValue- the infinity symbols- Returns:
- a new instance
-
withMinusSign
Creates a new instance with the specified minus sign symbols.- Parameters:
newValue- the minus sign symbols- Returns:
- a new instance
-
withNaN
Creates a new instance with the specified NaN symbols.- Parameters:
newValue- the NaN symbols- Returns:
- a new instance
-
withPlusSign
Creates a new instance with the specified plus sign symbols.- Parameters:
newValue- the plus sign symbols- Returns:
- a new instance
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
decimalSeparator
Returns the value of thedecimalSeparatorrecord component.- Returns:
- the value of the
decimalSeparatorrecord component
-
groupingSeparator
Returns the value of thegroupingSeparatorrecord component.- Returns:
- the value of the
groupingSeparatorrecord component
-
exponentSeparator
Returns the value of theexponentSeparatorrecord component.- Returns:
- the value of the
exponentSeparatorrecord component
-
minusSign
-
plusSign
-
infinity
-
nan
-
digits
-