Interface NumberParseUtilStrategy

All Known Implementing Classes:
MixedParseStrategy, OnlyCommasParseStrategy, OnlyPeriodsParseStrategy, SingleDelimiterTemplate

public interface NumberParseUtilStrategy
Strategy for parsing numbers with specific separator patterns.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canHandle(String numberStr, int commaCount, int periodCount)
    Determine 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.
  • Method Details

    • parseNumber

      FlexibleNumberParseResult parseNumber(String numberStr, int commaCount, int periodCount)
      Parse a number string using this strategy's specific rules.
      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
    • canHandle

      boolean canHandle(String numberStr, int commaCount, int periodCount)
      Determine if this strategy can handle the given separator pattern.
      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