Package app.babylon.text
Class Currencys
java.lang.Object
app.babylon.text.Currencys
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 Summary
Modifier and TypeMethodDescriptionstatic CurrencyParses a currency from the whole character sequence.static Currencyparse(CharSequence s, int start, int end) Parses a character slice into aCurrency.
-
Method Details
-
parse
Parses a currency from the whole character sequence.- Parameters:
s- source text- Returns:
- parsed currency or
null
-
parse
Parses a character slice into aCurrency.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 textstart- the start indexend- the exclusive end index- Returns:
- the parsed currency, or
nullwhen parsing fails
-