Package net.sf.gridarta.utils
Class NumberUtils
- java.lang.Object
-
- net.sf.gridarta.utils.NumberUtils
-
public class NumberUtils extends java.lang.ObjectUtility class for parsing strings into numbers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleparseDouble(@NotNull java.lang.String s)Parses a double string.static intparseInt(@NotNull java.lang.String s)Parses an integer string.static intparseInt(@NotNull java.lang.String s, int defaultValue)Parses an integer string.static longparseLong(@NotNull java.lang.String s)Parses a long string.
-
-
-
Method Detail
-
parseInt
public static int parseInt(@NotNull @NotNull java.lang.String s)Parses an integer string.- Parameters:
s- the string to parse- Returns:
- the integer value or zero if value not readable
-
parseInt
public static int parseInt(@NotNull @NotNull java.lang.String s, int defaultValue)Parses an integer string.- Parameters:
s- the string to parsedefaultValue- the default value- Returns:
- the integer value or the default value if value not readable
-
parseLong
public static long parseLong(@NotNull @NotNull java.lang.String s)Parses a long string.- Parameters:
s- the string to parse- Returns:
- the long value or zero if value not readable
-
parseDouble
public static double parseDouble(@NotNull @NotNull java.lang.String s)Parses a double string.- Parameters:
s- the string to parse- Returns:
- the double value or zero if value not readable
-
-