Package com.helger.commons.locale
Class LocaleParser
- java.lang.Object
-
- com.helger.commons.locale.LocaleParser
-
@Immutable public final class LocaleParser extends Object
Helper class to safely parse formatted numbers.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Numberparse(String sStr, NumberFormat aNF)static Numberparse(String sStr, NumberFormat aNF, Number aDefault)static Numberparse(String sStr, Locale aParseLocale)static Numberparse(String sStr, Locale aParseLocale, Number aDefault)static BigDecimalparseBigDecimal(String sStr, DecimalFormat aNF)static BigDecimalparseBigDecimal(String sStr, DecimalFormat aNF, BigDecimal aDefault)static BigDecimalparseBigDecimal(String sStr, NumberFormat aNF)static BigDecimalparseBigDecimal(String sStr, NumberFormat aNF, BigDecimal aDefault)static BigDecimalparseBigDecimal(String sStr, Locale aParseLocale)static BigDecimalparseBigDecimal(String sStr, Locale aParseLocale, BigDecimal aDefault)static byteparseByte(String sStr, NumberFormat aNF, byte nDefault)static byteparseByte(String sStr, Locale aParseLocale, byte nDefault)static doubleparseDouble(String sStr, NumberFormat aNF, double dDefault)static doubleparseDouble(String sStr, Locale aParseLocale, double dDefault)static floatparseFloat(String sStr, NumberFormat aNF, float fDefault)static floatparseFloat(String sStr, Locale aParseLocale, float fDefault)static intparseInt(String sStr, NumberFormat aNF, int nDefault)static intparseInt(String sStr, Locale aParseLocale, int nDefault)static longparseLong(String sStr, NumberFormat aNF, long nDefault)static longparseLong(String sStr, Locale aParseLocale, long nDefault)static shortparseShort(String sStr, NumberFormat aNF, short nDefault)static shortparseShort(String sStr, Locale aParseLocale, short nDefault)
-
-
-
Method Detail
-
parse
@Nullable public static Number parse(String sStr, @Nonnull Locale aParseLocale, @Nullable Number aDefault)
-
parse
@Nullable public static Number parse(@Nullable String sStr, @Nonnull NumberFormat aNF, @Nullable Number aDefault)
-
parseFloat
public static float parseFloat(@Nullable String sStr, @Nonnull Locale aParseLocale, float fDefault)
-
parseFloat
public static float parseFloat(@Nullable String sStr, @Nonnull NumberFormat aNF, float fDefault)
-
parseDouble
public static double parseDouble(@Nullable String sStr, @Nonnull Locale aParseLocale, double dDefault)
-
parseDouble
public static double parseDouble(@Nullable String sStr, @Nonnull NumberFormat aNF, double dDefault)
-
parseByte
public static byte parseByte(@Nullable String sStr, @Nonnull Locale aParseLocale, byte nDefault)
-
parseByte
public static byte parseByte(@Nullable String sStr, @Nonnull NumberFormat aNF, byte nDefault)
-
parseInt
public static int parseInt(@Nullable String sStr, @Nonnull Locale aParseLocale, int nDefault)
-
parseInt
public static int parseInt(@Nullable String sStr, @Nonnull NumberFormat aNF, int nDefault)
-
parseLong
public static long parseLong(@Nullable String sStr, @Nonnull Locale aParseLocale, long nDefault)
-
parseLong
public static long parseLong(@Nullable String sStr, @Nonnull NumberFormat aNF, long nDefault)
-
parseShort
public static short parseShort(@Nullable String sStr, @Nonnull Locale aParseLocale, short nDefault)
-
parseShort
public static short parseShort(@Nullable String sStr, @Nonnull NumberFormat aNF, short nDefault)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull Locale aParseLocale)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull Locale aParseLocale, @Nullable BigDecimal aDefault)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull DecimalFormat aNF)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull DecimalFormat aNF, @Nullable BigDecimal aDefault)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull NumberFormat aNF)
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull NumberFormat aNF, @Nullable BigDecimal aDefault)
-
-