public class IntUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
POINT_PREFIX |
Constructor and Description |
---|
IntUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Integer> |
asList(String str)
take a string of ints (eg: 1,2,3,4), and return a List of Integers
|
static List<Integer> |
asList(String str,
String sep)
take a string of ints (eg: 1[sep]2[sep]3[sep]4), and return a List of Integers
|
static Double |
getDoubleFromString(String input) |
static Integer |
getIntegerFromString(String input) |
static Integer |
getIntegerFromString(String input,
Integer def) |
static Integer |
getIntegerFromSubString(String input,
int len) |
static Integer |
getIntegerFromSubString(String target,
String suffix) |
static Integer |
getIntegerFromSubString(String target,
String prefix,
String suffix)
expect an Integer between prefix and suffix
eg: if is this is our string "Hi there #2112, how are you" then a call of
getIntegerFromSubString("Hi there #2112, how are you", "#", ","); will return 2112
note: if " " is specified, and there is no space from prefix to end of line, then the whole
line is evaluated
|
static int |
getIntFromString(String input) |
static long |
getLongFromString(String input) |
static long |
getLongFromString(String input,
long def) |
static short |
getShortFromString(String input) |
static Integer |
getZipFromString(String zipStr) |
static boolean |
looksLikeCoordinate(String str)
does this string appear to be a coordinate of some sort
|
static double |
roundDouble(double d,
int places) |
public static final String POINT_PREFIX
public static boolean looksLikeCoordinate(String str)
public static final double roundDouble(double d, int places)
public static List<Integer> asList(String str)
public static List<Integer> asList(String str, String sep)
public static short getShortFromString(String input)
public static int getIntFromString(String input)
public static Integer getIntegerFromSubString(String target, String prefix, String suffix)
target
- prefix
- suffix
- public static long getLongFromString(String input)
public static long getLongFromString(String input, long def)
Copyright © 2018. All rights reserved.