Package app.babylon.text
Enum Class BigDecimals.DecimalPolicy
- All Implemented Interfaces:
Serializable,Comparable<BigDecimals.DecimalPolicy>,Constable
- Enclosing class:
BigDecimals
Policy used to resolve ambiguous decimal separators.
A decimal is ambiguous when the text contains exactly one comma or period,
that separator is followed by exactly three digits, and no other separator
signal is present. For example 100,379 may mean either 100379
or 100.379. A grouping space, non-breaking space, narrow non-breaking
space, or a second separator removes the ambiguity.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionInfer separators from the text.Treat comma as the decimal separator and period as a grouping separator.Treat period as the decimal separator and comma as a grouping separator. -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimals.DecimalPolicyfromLocale(Locale locale) Returns a decimal policy from the decimal separator used by the supplied locale.static BigDecimals.DecimalPolicyReturns the enum constant of this class with the specified name.static BigDecimals.DecimalPolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Infer separators from the text. When a single comma is ambiguous, treats it as a grouping separator. A single ambiguous period is treated as a decimal separator. -
PERIOD_DECIMAL
Treat period as the decimal separator and comma as a grouping separator. -
COMMA_DECIMAL
Treat comma as the decimal separator and period as a grouping separator.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromLocale
Returns a decimal policy from the decimal separator used by the supplied locale.- Parameters:
locale- locale to inspect- Returns:
- locale-derived decimal policy, or
AUTOwhen no comma or period decimal separator is defined
-