Package org.kigalisim.lang.localization
Class MixedParseStrategy
java.lang.Object
org.kigalisim.lang.localization.MixedParseStrategy
- All Implemented Interfaces:
NumberParseUtilStrategy
Parse strategy for numbers with both comma and period separators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if this strategy can handle the given separator pattern.parseNumber(String numberStr, int commaCount, int periodCount) Parse a number string using this strategy's specific rules.
-
Constructor Details
-
MixedParseStrategy
public MixedParseStrategy()Constructs a new MixedParseStrategy.
-
-
Method Details
-
canHandle
Description copied from interface:NumberParseUtilStrategyDetermine if this strategy can handle the given separator pattern.- Specified by:
canHandlein interfaceNumberParseUtilStrategy- Parameters:
numberStr- The number string to analyzecommaCount- Number of commas in the stringperiodCount- Number of periods in the string- Returns:
- true if this strategy can handle the pattern
-
parseNumber
Description copied from interface:NumberParseUtilStrategyParse a number string using this strategy's specific rules.- Specified by:
parseNumberin interfaceNumberParseUtilStrategy- Parameters:
numberStr- The cleaned number string (without sign)commaCount- Number of commas in the stringperiodCount- Number of periods in the string- Returns:
- FlexibleNumberParseResult containing either parsed number or error
-