|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.lbl.genome.common.StringUtil
public class StringUtil
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static java.lang.String |
condenseStrings(java.lang.String[] strings)
Merge a String array into a single String using a chosen delimiter that does not occur in any of the strings. |
static java.lang.String |
decode(java.lang.String s)
Decodes a x-www-form-urlencoded to a String. |
static java.lang.String |
decodeSpaces(java.lang.String string)
replace "%20" by space |
static java.lang.String |
encodeSpaces(java.lang.String string)
replace spaces by "%20" |
static java.lang.String |
filterDigits(java.lang.String str)
throw exception if string contains non-digit characters |
static java.lang.String[] |
getAutoStringList(java.lang.String string)
Tokenize a String list using the first character of the string as the delimiter. |
static java.lang.String |
getDateString(java.util.Date date)
get Date String |
static java.lang.String |
getDecimalString(double value,
int decimalCount)
Parses a formatted string representation of a double value, with the specified number of decimal digits. |
static java.lang.Double |
getDouble(java.lang.String doubleString)
Converts a String to a Double object. |
static double |
getDouble(java.lang.String doubleString,
double defaultValue)
Converts a String to a double. |
static double |
getDouble(java.awt.TextField textField,
double defaultValue)
Converts the input in a TextField to a double. |
static double |
getDouble(java.awt.TextField textField,
double defaultValue,
double minValue,
double maxValue)
Converts the input in a TextField to a double, constrained by min and max values. |
static int |
getInt(java.lang.String string,
int defaultValue)
Converts a String to an int. |
static int |
getInt(java.lang.String string,
int defaultValue,
int minValue,
int maxValue)
Converts a String to an int, constrained by min and max values. |
static int |
getInt(java.awt.TextField textField,
int defaultValue)
Converts the input in a TextField to an int. |
static int |
getInt(java.awt.TextField textField,
int defaultValue,
int minValue,
int maxValue)
Converts the input in a TextField to an int, constrained by min and max values. |
static int[] |
getIntArray(java.lang.String listString,
int delimiter)
Returns an Array of int using the given delimiter. |
static java.lang.Integer |
getInteger(java.lang.String string)
Converts a String to an Integer. |
static java.lang.Long |
getLong(java.lang.String string)
Converts a String to a Long. |
static long |
getLong(java.lang.String string,
long defaultValue)
Converts a String to a long. |
static long |
getLong(java.awt.TextField textField,
long defaultValue)
Converts the input in a TextField to a long. |
static long |
getLong(java.awt.TextField textField,
long defaultValue,
long minValue,
long maxValue)
Converts the input in a TextField to a long, constrained by min and max values. |
static long[] |
getLongArray(java.lang.String listString,
int delimiter)
Returns an Array of long using the given delimiter. |
static int |
getOS(java.lang.String string)
Returns the Operating System being used, as defined in the specified string. |
static java.lang.String |
getStackTrace(java.lang.Throwable t)
|
static java.lang.String[] |
getStrings(java.util.Enumeration enumeration)
Returns an Array of strings from an Enumeration object. |
static java.lang.String[] |
getStrings(java.lang.String string,
int delimiter,
boolean emptyTokens)
Tokenize a string using the given delimiter and return an array of the tokens found in the string. |
static java.lang.String[] |
getStrings(java.lang.String string,
int startIndex,
int delimiter,
boolean emptyTokens)
Tokenize a string starting at the specified index. |
static boolean |
isInteger(java.lang.String s)
|
static java.lang.Long |
parseFormattedLong(java.lang.String string)
Parses a formatted string representation of a chromosome coordinate. |
static java.lang.String |
quote(java.lang.String string)
escape quotations |
static java.lang.String |
replaceChar(java.lang.String string,
char searchCh,
char replaceCh)
Replace all occurrences of one specified character with the other specified character. |
static java.lang.String[] |
split(java.lang.String string,
java.lang.String token)
split the string using token. |
static java.lang.String[] |
split(java.lang.String string,
java.lang.String token,
boolean returnDelims)
split the string using token. |
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String pre)
return true if firts strings start with the same letters, ignoring letter case |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static boolean isInteger(java.lang.String s)
public static java.lang.Integer getInteger(java.lang.String string)
public static int getInt(java.lang.String string, int defaultValue)
public static int getInt(java.awt.TextField textField, int defaultValue)
public static int getInt(java.awt.TextField textField, int defaultValue, int minValue, int maxValue)
public static int getInt(java.lang.String string, int defaultValue, int minValue, int maxValue)
public static java.lang.Long getLong(java.lang.String string)
public static long getLong(java.lang.String string, long defaultValue)
public static long getLong(java.awt.TextField textField, long defaultValue)
public static long getLong(java.awt.TextField textField, long defaultValue, long minValue, long maxValue)
public static java.lang.Double getDouble(java.lang.String doubleString)
public static double getDouble(java.lang.String doubleString, double defaultValue)
public static double getDouble(java.awt.TextField textField, double defaultValue)
public static double getDouble(java.awt.TextField textField, double defaultValue, double minValue, double maxValue)
public static java.lang.String[] getStrings(java.util.Enumeration enumeration)
public static int[] getIntArray(java.lang.String listString, int delimiter)
public static long[] getLongArray(java.lang.String listString, int delimiter)
public static java.lang.String getStackTrace(java.lang.Throwable t)
public static java.lang.Long parseFormattedLong(java.lang.String string)
public static java.lang.String getDecimalString(double value, int decimalCount)
public static java.lang.String[] getStrings(java.lang.String string, int delimiter, boolean emptyTokens)
public static java.lang.String[] getStrings(java.lang.String string, int startIndex, int delimiter, boolean emptyTokens)
public static java.lang.String[] getAutoStringList(java.lang.String string)
public static java.lang.String condenseStrings(java.lang.String[] strings)
public static java.lang.String decode(java.lang.String s)
s
- the String to decode
public static java.lang.String quote(java.lang.String string)
string
- String
public static java.lang.String getDateString(java.util.Date date)
date
- Date
public static java.lang.String replaceChar(java.lang.String string, char searchCh, char replaceCh)
public static java.lang.String[] split(java.lang.String string, java.lang.String token)
string
- Stringtoken
- String
public static java.lang.String[] split(java.lang.String string, java.lang.String token, boolean returnDelims)
string
- Stringtoken
- StringreturnDelims
- boolean
public static java.lang.String encodeSpaces(java.lang.String string)
string
- String
public static java.lang.String decodeSpaces(java.lang.String string)
string
- String
public static int getOS(java.lang.String string)
public static java.lang.String filterDigits(java.lang.String str) throws VGBException
str
- String
VGBException
public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String pre)
str
- Stringpre
- String
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |