Class MixedParseStrategy

java.lang.Object
org.kigalisim.lang.localization.MixedParseStrategy
All Implemented Interfaces:
NumberParseUtilStrategy

public class MixedParseStrategy extends Object implements NumberParseUtilStrategy
Parse strategy for numbers with both comma and period separators.
  • Constructor Details

    • MixedParseStrategy

      public MixedParseStrategy()
      Constructs a new MixedParseStrategy.
  • Method Details

    • canHandle

      public boolean canHandle(String numberStr, int commaCount, int periodCount)
      Description copied from interface: NumberParseUtilStrategy
      Determine if this strategy can handle the given separator pattern.
      Specified by:
      canHandle in interface NumberParseUtilStrategy
      Parameters:
      numberStr - The number string to analyze
      commaCount - Number of commas in the string
      periodCount - Number of periods in the string
      Returns:
      true if this strategy can handle the pattern
    • parseNumber

      public FlexibleNumberParseResult parseNumber(String numberStr, int commaCount, int periodCount)
      Description copied from interface: NumberParseUtilStrategy
      Parse a number string using this strategy's specific rules.
      Specified by:
      parseNumber in interface NumberParseUtilStrategy
      Parameters:
      numberStr - The cleaned number string (without sign)
      commaCount - Number of commas in the string
      periodCount - Number of periods in the string
      Returns:
      FlexibleNumberParseResult containing either parsed number or error