Class Currencys

java.lang.Object
app.babylon.text.Currencys

public final class Currencys extends Object
Fast currency parsing helpers optimized for common major three-letter codes.

The hot path avoids intermediate String allocation for the built-in fast set of uppercase currency codes, then falls back to a trimmed and normalized parse for less common inputs.

  • Method Details

    • parse

      public static Currency parse(CharSequence s)
    • parse

      public static Currency parse(CharSequence s, int offset, int length)
      Parses a character slice into a Currency.

      The fast path is optimised for common major currencies already presented as three uppercase ASCII letters. Less common or messier inputs fall back to a normalised parse using Currency.getInstance(String).

      Parameters:
      s - the source text
      offset - the start offset
      length - the slice length
      Returns:
      the parsed currency, or null when parsing fails