|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.StringTools
public class StringTools
Provides various String parsing/format utilities
Nested Class Summary | |
---|---|
static class |
StringTools.FilterNumber
Class used to parse numeric values |
static class |
StringTools.HTMLFilterType
|
static interface |
StringTools.KeyValueMap
KeyValueMap interface. |
static class |
StringTools.KeyValueMap_SBIndex
KeyValueMap_SBIndex interface. |
static class |
StringTools.RegexIndex
|
static interface |
StringTools.ValueFilter
ValueFilter interface. |
Field Summary | |
---|---|
static java.lang.String |
ARG_DELIM
|
static char |
ARRAY_DELIM
|
static char |
ARRAY_DOUBLE_QUOTE
|
static char |
ARRAY_QUOTE
|
static char |
ARRAY_SINGLE_QUOTE
|
static java.lang.String |
ArraySeparator
|
static char |
BACKSPACE
|
static char |
CARRIAGE_RETURN
|
static java.lang.String |
CharEncoding_8859_1
|
static java.lang.String |
CharEncoding_US_ASCII
|
static java.lang.String |
CharEncoding_UTF_16
|
static java.lang.String |
CharEncoding_UTF_8
|
static java.lang.String |
DFT_DELIM
|
static int |
ELAPSED_FORMAT_HHHh
|
static int |
ELAPSED_FORMAT_HHHhh
|
static int |
ELAPSED_FORMAT_HHMM
|
static int |
ELAPSED_FORMAT_HHMMSS
|
static int |
ELAPSED_FORMAT_MMMSS
|
static int |
ELAPSED_FORMAT_SS
|
static char |
FORM_FEED
|
static java.lang.String |
FORMAT_DATE
|
static java.lang.String |
FORMAT_DATE2
|
static java.lang.String |
FORMAT_TIME
|
static java.lang.String |
HEX
|
static java.lang.String |
HTML_AMP
|
static java.lang.String |
HTML_APOS
|
static java.lang.String |
HTML_br
|
static java.lang.String |
HTML_BR
|
static java.lang.String |
HTML_DEG
|
static java.lang.String |
HTML_DOUBLE_QUOTE
|
static java.lang.String |
HTML_GT
|
static java.lang.String |
HTML_HR
|
static java.lang.String |
HTML_LT
|
static java.lang.String |
HTML_QUOTE
|
static java.lang.String |
HTML_SINGLE_QUOTE
|
static java.lang.String |
HTML_SP
|
static java.lang.String |
KEY_END
|
static java.lang.String |
KEY_START
|
static char |
KEY_START_ESC
|
static char |
KeyValSeparatorChar
|
static char[] |
KeyValSeparatorChars
|
static char |
KeyValSeparatorCOLON
|
static char |
KeyValSeparatorEQUAL
|
static char |
NEW_LINE
|
static char |
PropertySeparatorChar
|
static char |
PropertySeparatorSEMIC
|
static char |
PropertySeparatorSPACE
|
static java.lang.String |
STRING_FALSE
|
static java.lang.String |
STRING_TRUE
|
static int |
STRIP_EXCLUDE
|
static int |
STRIP_INCLUDE
|
static char |
TAB
|
static java.lang.String |
WhitespaceChars
|
Constructor Summary | |
---|---|
StringTools()
|
Method Summary | ||
---|---|---|
static java.lang.String |
blankDefault(java.lang.Object target,
java.lang.String dft)
Returns the specified String if not blank, or the default String if the specified String is blank |
|
static java.lang.String |
blankDefault(java.lang.String target,
java.lang.String dft)
Returns the specified String if not blank, or the default String if the specified String is blank |
|
static java.lang.Class |
classForName(java.lang.String n)
Returns the Class instance for the specified name, or null if the name does not specify a valid class. |
|
static java.lang.String |
className(java.lang.Object c)
Returns the class name for the specified object. |
|
static int |
compare(byte[] b1,
byte[] b2)
Compares byte arrays for equality |
|
static int |
compare(byte[] b1,
byte[] b2,
int len)
Compares byte arrays for equality |
|
static int |
compare(byte[] b1,
java.lang.String s)
Compares byte arrays for equality |
|
static boolean |
compareEquals(byte[] b1,
byte[] b2)
Returns true if the specified byte arrays are equals |
|
static boolean |
compareEquals(byte[] b1,
byte[] b2,
int len)
Returns true if the specified byte arrays are equals |
|
static boolean |
compareEquals(byte[] b,
java.lang.String s)
Returns true if the specified byte array is equal to the specified String |
|
static int |
compareVersions(java.lang.String V1,
java.lang.String V2)
Compare version strings of the form "a.b.c-B##". Examples: "1.2.3" < "1.2.3.4" "5.22" > "5.9" "3.4-B9" < "3.4-B12" This comparison method makes the general assumption that "a", "b", "c", etc. |
|
static java.lang.String |
compressDigits(long num)
Obfuscate the specified long value into a String |
|
static java.lang.String |
compressDigits(long num,
java.lang.String alpha)
Compress/Obfuscate the specified long value into a String using the specified alphabet (Note: In this context "compress" means the length of the String representation, and not the number of byte required to represent the long value). |
|
static boolean |
contains(java.lang.String t,
java.lang.String m)
Returns true if the pattern string is contained within the target string. |
|
static boolean |
containsIgnoreCase(java.lang.String t,
java.lang.String m)
Returns true if the pattern string is contained within the target string, ignoring case. |
|
static java.lang.String |
createRandomString(int len)
Creates a random String value with the specified length |
|
static java.lang.String |
createRandomString(int len,
java.lang.String alpha)
Creates a random String value with the specified length |
|
static java.lang.String |
decodeEscapedCharacters(java.lang.String text)
Replace all "\\n" with "\n". Replace all "\\r" with "\r". Replace all "\\t" with "\t". |
|
static java.lang.StringBuffer |
decodeEscapedCharacters(java.lang.StringBuffer sb)
Replace all "\\n" with "\n". Replace all "\\r" with "\r". Replace all "\\t" with "\t". |
|
static java.lang.String |
decodeNewline(java.lang.String text)
Replace all '\\n' with "\n". |
|
static java.lang.StringBuffer |
decodeNewline(java.lang.StringBuffer sb)
Replace all '\\n' with "\n". |
|
static long |
decompressDigits(java.lang.String str)
Decompress/Unobfuscate the specified String into a long value. |
|
static long |
decompressDigits(java.lang.String str,
java.lang.String alpha)
Decompress/Unobfuscate the specified String into a long value using the specified alphabet (this must be the same alphabet used to encode the long value) |
|
static int |
diff(byte[] b1,
byte[] b2)
Compares 2 byte arrays, returning the index of the byte where they differ |
|
static int |
diff(byte[] b1,
byte[] b2,
int len)
Compares 2 byte arrays, returning the index of the byte where they differ |
|
static int |
diff(java.lang.String s1,
java.lang.String s2)
Compares 2 Strings, returning the index of the character where they differ |
|
static java.lang.String |
encodeArray(java.util.List<java.lang.Object> list)
Encodes a list of Strings/Objects into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.util.List<java.lang.Object> list,
boolean alwaysQuote)
Encodes a list of Strings/Objects into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.util.List<java.lang.Object> list,
char delim,
boolean alwaysQuote)
Encodes a list of Strings/Objects into a single String, using the specified character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object list)
Encodes an Object containing a list of Strings into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object[] list)
Encodes an array of Strings/Objects into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object[] list,
boolean alwaysQuote)
Encodes an array of Strings/Objects into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object[] list,
char delim,
boolean alwaysQuote)
Encodes an array of Strings/Objects into a single String, using the specified character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object[] list,
int ofs,
int max,
char delim,
boolean alwaysQuote)
Encodes an array of Strings/Objects into a single String, using the specified character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object list,
boolean alwaysQuote)
Encodes an Object containing a list of Strings into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object list,
char delim,
boolean alwaysQuote)
Encodes an array/list of Strings/Objects into a single String, using the specified character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.Object list,
int ofs,
int max,
char delim,
boolean alwaysQuote)
Encodes an array/list of Strings/Objects into a single String, using the specified character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.String[] list)
Encodes an array of Strings into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeArray(java.lang.String[] list,
boolean alwaysQuote)
Encodes an array of Strings into a single String, using the "," character as the String field delimiter. |
|
static java.lang.String |
encodeCSV(java.lang.String[] d)
Encode the specified array of Strings based on CSV encoding rules |
|
static java.lang.String |
encodeCSV(java.lang.String[] d,
boolean checkTextQuote)
Encode the specified array of Strings based on CSV encoding rules |
|
static java.lang.String |
encodeEscapedCharacters(java.lang.String text)
Replace all "\n" with "\\n". Replace all "\r" with "\\r". Replace all "\t" with "\\t". |
|
static java.lang.StringBuffer |
encodeEscapedCharacters(java.lang.StringBuffer sb)
Replace all "\n" with "\\n". Replace all "\r" with "\\r". Replace all "\t" with "\\t". |
|
static java.lang.String |
encodeNewline(java.lang.String text)
Remove all '\r', and replace all '\n' with "\\n". |
|
static java.lang.StringBuffer |
encodeNewline(java.lang.StringBuffer sb)
Remove all '\r', and replace all '\n' with "\\n". |
|
static boolean |
endsWith(java.lang.String t,
java.lang.String p)
Returns true if the specified target String ends with the pattern String |
|
static boolean |
endsWithIgnoreCase(java.lang.String t,
java.lang.String p)
Returns true if the specified target String ends with the pattern String without regard to case (a method that should be on the String class itself, but isn't) |
|
static boolean |
endsWithIgnoreCase(java.lang.String t,
java.lang.String[] p)
Returns true if the specified target String ends with one of the pattern Strings in the specified array, without regard to case. |
|
static boolean |
equals(java.lang.String s1,
java.lang.String s2)
Returns true if the 2 strings are equals (or are both null), false otherwise |
|
static boolean |
equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
Returns true if the 2 strings are equals (or are both null), false otherwise |
|
static java.lang.String |
escapeChars(java.lang.String text)
Replace all "\n" with "\\n". Replace all "\r" with "\\r". Replace all "\t" with "\\t". |
|
static java.lang.String |
escapeJSON(java.lang.String s)
Converts the specified String to a JSON escaped value String. |
|
static java.lang.String |
escapeUnicode(java.lang.String s)
Converts the specified String to a Unicode escaped String. That is, convert non-ASCII characters to ' ' encoded characters. |
|
static java.lang.String |
format(java.math.BigInteger val,
java.lang.String fmt)
Format/Convert the specified BigInteger value to a String, based on the specified format pattern |
|
static java.lang.String |
format(java.math.BigInteger val,
java.lang.String fmt,
int fieldSize)
Format/Convert the specified BigInteger value to a String, based on the specified format pattern. The format String may be one of the following: null - String.valueOf(val) will be returned. "Xn" - 'val' will be formatted as an 'n' length hex value. "%nf" - 'val' will be formatted as an 'n' length field value. |
|
static java.lang.String |
format(double val,
java.lang.String fmt)
Format/Convert the specified double value to a String, based on the specified format pattern |
|
static java.lang.String |
format(double val,
java.lang.String fmt,
int fieldSize)
Format/Convert the specified double value to a String, based on the specified format pattern If the format String begins with '%', then String.format(...) will be used. Otherwise DecimalFormat will be used. |
|
static java.lang.String |
format(int val,
java.lang.String fmt)
Format/Convert the specified int value to a String, based on the specified format pattern |
|
static java.lang.String |
format(int val,
java.lang.String fmt,
int fieldSize)
Format/Convert the specified int value to a String, based on the specified format pattern |
|
static java.lang.String |
format(long val,
java.lang.String fmt)
Format/Convert the specified long value to a String, based on the specified format pattern |
|
static java.lang.String |
format(long val,
java.lang.String fmt,
int fieldSize)
Format/Convert the specified long value to a String, based on the specified format pattern. The format String may be one of the following: null - String.valueOf(val) will be returned. "time" - 'val' will be formatted as a date/time value. "Xn" - 'val' will be formatted as an 'n' length hex value. "%nf" - 'val' will be formatted as an 'n' length field value. |
|
static java.lang.String |
format(short val,
java.lang.String fmt)
Format/Convert the specified short value to a String, based on the specified format pattern |
|
static java.lang.String |
format(short val,
java.lang.String fmt,
int fieldSize)
Format/Convert the specified short value to a String, based on the specified format pattern |
|
static java.lang.String |
formatElapsedSeconds(long elapsedSec,
int fmt)
Format elapsed second value |
|
static java.lang.StringBuffer |
formatHexString(byte[] b)
This method prints the specified byte array to a String hex representation showing the contained bytes with corresponding displayed printable characters. |
|
static java.lang.StringBuffer |
formatHexString(byte[] b,
int blockLen)
This method prints the specified byte array to a String hex representation showing the contained bytes with corresponding displayed printable characters. |
|
static java.lang.StringBuffer |
formatHexString(byte[] b,
int bOfs,
int bLen,
int blockLen,
boolean showAscii,
java.lang.StringBuffer sb)
This method prints the specified byte array to a String hex representation showing the contained bytes with corresponding displayed printable characters. |
|
static java.lang.StringBuffer |
formatHexString(byte[] b,
int blockLen,
java.lang.StringBuffer sb)
This method prints the specified byte array to a String hex representation showing the contained bytes with corresponding displayed printable characters. |
|
static java.lang.String |
formatLine(java.lang.String fmt,
java.lang.Object... v)
Expands the specified String format to include the items found in the array. |
|
static byte[] |
getBytes(char[] c)
Converts the specified char array into a byte array. |
|
static byte[] |
getBytes(java.lang.String s)
Converts the specified String into a byte array based on the default character set (see StringTools.getCharacterEncoding() ) |
|
static byte[] |
getBytes(java.lang.StringBuffer sb)
Converts the String represented by the specified StringBuffer into a byte array based on the default character set (see StringTools.getCharacterEncoding() ) |
|
static byte[] |
getBytesHex(java.lang.String s)
Used for debug purposes only. |
|
static java.lang.String |
getCharacterEncoding()
Gets the character encoding used to encode/decode Strings |
|
static java.lang.String[] |
getCharacterEncodings()
Returns an array of available character encodings |
|
static char[] |
getChars(byte[] b)
Converts the specified byte array to an array of chars. |
|
static char[] |
getChars(java.lang.String s)
Return a 'char' array of the specified String |
|
static int |
hexIndex(char ch)
Returns the value of the specified hex character |
|
static int |
hexLength(java.lang.String data)
Returns the number of valid hex characters found in the specified String |
|
static char |
hexNybble(byte nybble)
Returns the hex character for the least significant nybble of the specified byte |
|
static char |
hexNybble(int nybble)
Returns the hex character for the least significant nybble of the specified byte |
|
static java.lang.String |
htmlFilter(java.lang.Object text,
StringTools.HTMLFilterType filterType)
Encode special HTML character string |
|
static java.lang.String |
htmlFilterText(java.lang.Object text)
Encode special HTML character string for node text |
|
static java.lang.String |
htmlFilterValue(java.lang.Object text)
Encode special HTML character string for attibute specification "value='xxx'" (NOT for URL parameter use. |
|
static int |
indexOf(byte[] B,
byte b)
Returns the position of the specified pattern byte within the byte array |
|
static int |
indexOf(char[] A,
char c)
Returns the position of the specified pattern character within the character array |
|
static int |
indexOf(java.lang.String tt,
char... cc)
Returns index/position of the first matching pattern character within the target String |
|
static int |
indexOf(java.lang.String t,
char c)
Returns index/position of the pattern character within the target String |
|
static int |
indexOf(java.lang.String tt,
int n,
char... cc)
Returns index/position of the first matching pattern character within the target String |
|
static int |
indexOf(java.lang.String t,
int n,
char c)
Returns index/position of the pattern character within the target String |
|
static int |
indexOf(java.lang.String tt,
int n,
java.lang.String... pp)
Returns index/position of the first matching pattern String within the target String |
|
static int |
indexOf(java.lang.String t,
int n,
java.lang.String p)
Returns index/position of the pattern String within the target String |
|
static int |
indexOf(java.lang.String tt,
java.lang.String... pp)
Returns index/position of the first matching pattern String within the target String |
|
static int |
indexOf(java.lang.String t,
java.lang.String p)
Returns index/position of the pattern String within the target String |
|
static int |
indexOfIgnoreCase(java.lang.String t,
java.lang.String p)
Returns index/position of the pattern String within the test String, without regard to case. |
|
static int |
indexOfIgnoreCase(java.lang.String tt,
java.lang.String[] pp)
Returns index/position of the first matching pattern String within the target String |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
java.util.Map<java.lang.String,java.lang.String> map)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement map |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
java.util.Map<java.lang.String,java.lang.String> map,
boolean htmlFilter)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement map |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
java.lang.String[][] rep)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement array |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
java.lang.String[][] rep,
boolean htmlFilter)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement array |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
StringTools.KeyValueMap rmap)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement map |
|
static java.lang.String |
insertKeyValues(java.lang.String text,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String dftDelim,
StringTools.KeyValueMap rmap,
boolean htmlFilter)
Searches the input String for key variables (determined by the specified start/end delimiters) and replaces matching keys with the values specified in the replacement map |
|
static boolean |
isAlphaNumeric(byte[] b)
Returns true if the specified byte array contains only AlphaNumeric characters |
|
static boolean |
isAlphaNumeric(byte[] b,
int ofs)
Returns true if the specified byte array contains only AlphaNumeric characters |
|
static boolean |
isAlphaNumeric(byte[] b,
int ofs,
int len)
Returns true if the specified byte array contains only AlphaNumeric characters |
|
static boolean |
isAlphaNumeric(java.lang.String s,
boolean inclSpace)
Returns true if the specified String contains only alpha-numeric characters |
|
static boolean |
isAlphaNumeric(java.lang.String s,
char... x)
Returns true if the specified String contains only alpha-numeric characters |
|
static boolean |
isAssignableFrom(java.lang.Class<?> targetClass,
java.lang.Class<?> testClass)
Returns true if the argument class can be assigned to the target class |
|
static boolean |
isAssignableFrom(java.lang.String targetClassName,
java.lang.Class testClass)
Returns true if the argument class can be assigned to the target class |
|
static boolean |
isBigInteger(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid BigInteger value |
|
static boolean |
isBigInteger(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid BigInteger value |
|
static boolean |
isBlank(java.lang.Object s)
Returns true if the specified argument is null, or the "toString" value contains 0 or more whitespace characters. |
|
static boolean |
isBlank(java.lang.String s)
Returns true if the specified argument is null, or contains 0 or more whitespace characters. |
|
static boolean |
isBlank(java.lang.StringBuffer s)
Returns true if the specified argument is null, or contains 0 or more whitespace characters. |
|
static boolean |
isBoolean(java.lang.Object data,
boolean strict)
Return true if the specified String contains a valid boolean value |
|
static boolean |
isBoolean(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid boolean value |
|
static boolean |
isDouble(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid double value |
|
static boolean |
isDouble(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid double value |
|
static boolean |
isFloat(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid float value |
|
static boolean |
isFloat(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid float value |
|
static boolean |
isHex(java.lang.String data,
boolean strict)
Returns true if the specified String contains hext characters |
|
static boolean |
isHexDigit(byte b)
Returns true if the specified character is a Hex digit |
|
static boolean |
isHexDigit(char ch)
Returns true if the specified character is a Hex digit |
|
static boolean |
isInt(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid int value |
|
static boolean |
isInt(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid int value |
|
static boolean |
isLong(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid long value |
|
static boolean |
isLong(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid long value |
|
static boolean |
isNumeric(java.lang.Object n)
Returns true if the specified String contains only decimal numeric characters |
|
static boolean |
isNumeric(java.lang.Object n,
boolean inclHex)
Returns true if the specified Object contains only decimal numeric characters |
|
static boolean |
isNumeric(java.lang.String s)
Returns true if the specified String contains only decimal numeric characters |
|
static boolean |
isNumeric(java.lang.String s,
boolean inclHex)
Returns true if the specified String contains only numeric characters |
|
static boolean |
isPrintableASCII(byte[] b)
Returns true if the specified byte array contains only printable ASCII characters |
|
static boolean |
isPrintableASCII(byte[] b,
boolean inclSpace)
Returns true if the specified byte array contains only printable ASCII characters |
|
static boolean |
isPrintableASCII(byte[] b,
int ofs,
int len,
boolean inclSpace)
Returns true if the specified byte array contains only printable ASCII characters |
|
static boolean |
isShort(java.lang.Object data,
boolean strict)
Return true if the specified Object contains a valid short value |
|
static boolean |
isShort(java.lang.String data,
boolean strict)
Return true if the specified String contains a valid short value |
|
static boolean |
isValidID(java.lang.String s,
char... x)
Returns true if the specified String is a valid ID. |
|
static java.lang.String |
join(double[] val,
char delim)
Concatenates the specified double array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(double[] val,
java.lang.String delim)
Concatenates the specified double array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(float[] val,
char delim)
Concatenates the specified float array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(float[] val,
java.lang.String delim)
Concatenates the specified float array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(int[] val,
char delim)
Concatenates the specified int array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(int[] val,
java.lang.String delim)
Concatenates the specified int array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Iterable<?> list,
char delim)
Concatenates the specified List objects into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Iterable<?> list,
int ofs,
char delim)
Concatenates the specified List objects into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Iterable<?> list,
int ofs,
java.lang.String delim)
Concatenates the specified List objects into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Iterable<?> list,
java.lang.String delim)
Concatenates the specified List objects into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(long[] val,
char delim)
Concatenates the specified long array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(long[] val,
java.lang.String delim)
Concatenates the specified long array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Object[] val,
char delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Object[] val,
int ofs,
char delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Object[] val,
int ofs,
java.lang.String delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.Object[] val,
java.lang.String delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.String[] val,
char delim)
Concatenates the specified String array into a single String using the specified character as the delimiter. |
|
static java.lang.String |
join(java.lang.String[] val,
int ofs,
char delim)
Concatenates the specified String array into a single String using the specified character as the delimiter. |
|
static java.lang.String |
join(java.lang.String[] val,
int ofs,
java.lang.String delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static java.lang.String |
join(java.lang.String[] val,
java.lang.String delim)
Concatenates the specified String array into a single String using the specified String as the delimiter. |
|
static int |
lastIndexOf(java.lang.String tt,
char... cc)
Returns index/position of the last matching pattern character within the target String |
|
static int |
lastIndexOf(java.lang.String t,
char c)
Returns last index/position of the pattern character within the target String |
|
static int |
lastIndexOf(java.lang.String tt,
int n,
char... cc)
Returns index/position of the last matching pattern character within the target String |
|
static int |
lastIndexOf(java.lang.String t,
int n,
char c)
Returns last index/position of the pattern character within the target String |
|
static int |
lastIndexOf(java.lang.String tt,
int n,
java.lang.String... pp)
Returns index/position of the last matching pattern String within the target String |
|
static int |
lastIndexOf(java.lang.String t,
int n,
java.lang.String p)
Returns last index/position of the pattern String within the target String |
|
static int |
lastIndexOf(java.lang.String tt,
java.lang.String... pp)
Returns index/position of the last matching pattern String within the target String |
|
static int |
lastIndexOf(java.lang.String t,
java.lang.String p)
Returns last index/position of the pattern String within the target String |
|
static java.lang.String |
leftAlign(java.lang.String s,
int len)
Pads the input String on the right with specified number of ' ' characters. |
|
static java.lang.String |
leftJustify(java.lang.String s,
int len)
See StringTools.leftAlign(String,int) |
|
static int |
length(java.lang.String s)
Return the length of the specified String |
|
static void |
main(java.lang.String[] argv)
Main entry point, used for debugging |
|
static java.lang.String |
padLeft(java.lang.String s,
char padChar,
int len)
Pads the input String on the left with specified number of pad characters. |
|
static java.lang.String |
padRight(java.lang.String s,
char padChar,
int len)
Pads the input String on the right with specified number of pad characters. |
|
static java.lang.StringBuffer |
padToIndex(java.lang.StringBuffer sb,
char padChar,
int ndx)
Append specified pad-character to StringBuffer, up to (but not including) the specified column/character index. |
|
static java.lang.String[] |
parseArray(java.lang.String s)
Parses the specified "," delimited String to an array of Strings. |
|
static java.lang.String[] |
parseArray(java.lang.String s,
char arrayDelim)
Parses the specified character delimited String to an array of Strings. |
|
static java.math.BigInteger |
parseBigInteger(java.lang.Object data,
java.math.BigInteger dft)
Parse the specified object into a BigInteger value |
|
static java.math.BigInteger |
parseBigInteger(java.lang.String data,
java.math.BigInteger dft)
Parse the specified String into a BigInteger value |
|
static java.math.BigInteger |
parseBigInteger(StringTools.FilterNumber num,
java.math.BigInteger dft)
Parse the specified FilterNumber into a BigInteger value |
|
static boolean |
parseBoolean(java.lang.Object data,
boolean dft)
Parse the specified Object into a boolean value |
|
static boolean |
parseBoolean(java.lang.String data,
boolean dft)
Parse the specified String into a boolean value |
|
static java.awt.Dimension |
parseDimension(java.lang.String data,
java.awt.Dimension dft)
Parse the specified String into a Dimension object |
|
static double |
parseDouble(byte[] b,
int ofs,
boolean isBigEndian,
double dft)
Parse the specified byte array, representing a IEEE 754 floating-point into a double value |
|
static double[] |
parseDouble(java.lang.Object[] data,
double dft)
Parse the specified Object array into a double array |
|
static double |
parseDouble(java.lang.Object data,
double dft)
Parse the specified object into a double value |
|
static double |
parseDouble(java.lang.String data,
double dft)
Parse the specified String into a double value |
|
static double |
parseDouble(StringTools.FilterNumber num,
double dft)
Parse the specified FilterNumber into a double value |
|
static float |
parseFloat(byte[] b,
int ofs,
boolean isBigEndian,
float dft)
Parse the specified byte array, representing a IEEE 754 floating-point into a float value |
|
static float |
parseFloat(java.lang.Object data,
float dft)
Parse the specified object into a float value |
|
static float |
parseFloat(java.lang.String data,
float dft)
Parse the specified String into a float value |
|
static float |
parseFloat(StringTools.FilterNumber num,
float dft)
Parse the specified FilterNumber into a float value |
|
static byte[] |
parseHex(java.lang.String data,
byte[] dft)
Parse the specified String, containing a hex representation, into a byte array |
|
static int |
parseHex(java.lang.String data,
int dft)
Parse the String containing a hex representation into an int (32-bit) value |
|
static long |
parseHex(java.lang.String data,
long dft)
Parse the String containing a hex representation into a long (64-bit) value |
|
static short |
parseHex(java.lang.String data,
short dft)
Parse the String containing a hex representation into an short (16-bit) value |
|
static java.lang.String |
parseHexAscii(java.lang.String data,
java.lang.String dft)
Parse the String containing a hex representation into an ASCII String value |
|
static int |
parseHexInt(java.lang.String data,
int dft)
Parse the String containing a hex representation into an int (32-bit) value |
|
static long |
parseHexLong(java.lang.String data,
long dft)
Parse the String containing a hex representation into a long (64-bit) value |
|
static short |
parseHexShort(java.lang.String data,
short dft)
Parse the String containing a hex representation into an short (16-bit) value |
|
static int |
parseInt(byte[] b,
int ofs,
int len,
boolean isBigEndian,
boolean signed,
int dft)
Parse the specified byte array an int value |
|
static int[] |
parseInt(java.lang.Object[] data,
int dft)
Parse the specified Object array into a int array |
|
static int |
parseInt(java.lang.Object data,
int dft)
Parse the specified object into a int value |
|
static int |
parseInt(java.lang.String data,
int dft)
Parse the specified String into a int value |
|
static int |
parseInt(StringTools.FilterNumber num,
int dft)
Parse the specified FilterNumber into a int value |
|
static long |
parseLong(byte[] b,
int ofs,
int len,
boolean isBigEndian,
boolean signed,
long dft)
Parse the specified byte array a long value |
|
static long[] |
parseLong(java.lang.Object[] data,
long dft)
Parse the specified Object array into a long array |
|
static long |
parseLong(java.lang.Object data,
long dft)
Parse the specified object into a long value |
|
static long |
parseLong(java.lang.String data,
long dft)
Parse the specified String into a long value |
|
static long |
parseLong(StringTools.FilterNumber num,
long dft)
Parse the specified FilterNumber into a long value |
|
static
|
parseNumber(java.lang.Object data,
java.lang.Class<?> numberClass,
java.lang.Number dft)
Parse the specified object into a Number value |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props)
Parses a series of properties in the specified String into a property map. |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props,
char propSep)
Parses a series of properties in the specified String into a property map. |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props,
char propSep,
char[] keyValSep)
Parses a series of properties in the specified String into a property map. |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props,
char propSep,
char[] keyValSep,
java.util.Map<java.lang.String,java.lang.String> properties)
Parses a series of properties in the specified String into a property map. |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props,
char propSep,
java.util.Map<java.lang.String,java.lang.String> properties)
Parses a series of properties in the specified String into a property map. |
|
static java.util.Map<java.lang.String,java.lang.String> |
parseProperties(java.lang.String props,
java.util.Map<java.lang.String,java.lang.String> properties)
Parses a series of properties in the specified String into a property map. |
|
static int |
parseQuote(char[] ch,
int a,
java.lang.StringBuffer sb)
Parse the specified character array into a non-quoted String |
|
static java.lang.String |
parseQuote(java.lang.String s)
Parse the specified quoted String into a non-quoted String |
|
static short |
parseShort(java.lang.Object data,
short dft)
Parse the specified object into a short value |
|
static short |
parseShort(java.lang.String data,
short dft)
Parse the specified String into a short value |
|
static short |
parseShort(StringTools.FilterNumber num,
short dft)
Parse the specified FilterNumber into a short value |
|
static java.lang.String |
parseString(byte[] data,
int ofs,
java.lang.String dft)
Parse the specified byte array into a String value (ASCII characterset only). |
|
static java.lang.String |
parseString(byte[] data,
java.lang.String dft)
Parse the specified byte array into a String value (ASCII characterset only). |
|
static java.lang.String |
parseString(java.lang.Object data,
java.lang.String dft)
Parse the specified Object into a String value |
|
static java.lang.String[] |
parseStringArray(java.lang.StringBuffer value,
char delim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String[] |
parseStringArray(java.lang.StringBuffer value,
java.lang.String sdelim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String[] |
parseStringArray(java.lang.StringBuffer value,
java.lang.String sdelim,
boolean trim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String[] |
parseStringArray(java.lang.String value,
char delim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String[] |
parseStringArray(java.lang.String value,
java.lang.String sdelim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String[] |
parseStringArray(java.lang.String value,
java.lang.String sdelim,
boolean trim)
Parse the character delimited input String into an array of Strings (similar to Perl's "split" function). If the input String is non-null, this method returns an array with at-least one entry. |
|
static java.lang.String |
quoteCSVString(java.lang.String s)
Quote the specified String based on CSV rules |
|
static java.lang.String |
quoteString(java.lang.String s)
Return the specified String as a Quoted String, using "double-quotes" |
|
static java.lang.String |
quoteString(java.lang.String s,
char q)
Return the specified String as a Quoted String, using the specified quote character |
|
static StringTools.RegexIndex |
regexIndexOf(java.lang.String target,
java.lang.String regex)
Returns regular expressing index of the specified regular expression within the target String |
|
static StringTools.RegexIndex |
regexIndexOf(java.lang.String target,
java.lang.String regex,
int ndx)
Returns regular expressing index of the specified regular expression within the target String |
|
static StringTools.RegexIndex |
regexIndexOf(StringTools.RegexIndex regNdx)
Finds the next occurance of the matching regular expression |
|
static boolean |
regexMatches(java.lang.String target,
java.lang.String regex)
Returns true if the target String matches the regular expression |
|
static java.lang.StringBuffer |
regexReplace(java.lang.StringBuffer target,
java.lang.String regexKey,
java.lang.String val)
Within the input 'target' StringBuffer, replaces all occurances of the regular expression 'regex', with the 'val' String. |
|
static java.lang.String |
regexReplace(java.lang.String target,
java.lang.String regex,
java.lang.String val)
Within the input 'target' String, replaces all occurances of the regular expression 'regex', with the 'val' String. |
|
static java.lang.StringBuffer |
replace(java.lang.StringBuffer sb,
java.lang.String key,
java.lang.String val)
Within the input 'sb' StringBuffer, replaces all occurances of the 'key' String with the 'val' String. |
|
static java.lang.String |
replace(java.lang.String text,
java.lang.String key,
java.lang.String val)
Within the input 'text' String, replaces all occurances of the 'key' String with the 'val' String. |
|
static java.lang.String |
replaceChars(java.lang.String src,
char ch,
char repChar)
Replaces specific characters in the input String with the specified replacement character |
|
static java.lang.String |
replaceChars(java.lang.String src,
java.lang.String chars,
char repChar)
Replaces specific characters in the input String with the specified replacement character |
|
static java.lang.String |
replaceChars(java.lang.String src,
java.lang.String chars,
java.lang.String repStr)
Replaces specific characters in the input String with the specified replacement String |
|
static java.lang.StringBuffer |
replaceKeys(java.lang.StringBuffer repText,
StringTools.KeyValueMap keyMap,
StringTools.ValueFilter filter,
java.lang.String keyStart,
java.lang.String keyEnd,
java.lang.String argDelim,
java.lang.String dftDelim,
boolean replaceEsc)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method. |
|
static java.lang.String |
replaceKeys(java.lang.String text,
StringTools.KeyValueMap keyMap)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method. |
|
static java.lang.String |
replaceKeys(java.lang.String text,
StringTools.KeyValueMap keyMap,
StringTools.ValueFilter filter)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method. |
|
static java.lang.String |
replaceKeys(java.lang.String text,
StringTools.KeyValueMap keyMap,
StringTools.ValueFilter filter,
java.lang.String keyStart,
java.lang.String keyEnd,
java.lang.String argDelim,
java.lang.String dftDelim)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method. |
|
static java.lang.String |
replaceWhitespace(java.lang.String src,
char repChar)
Replaces all whitespace found in the input String with the specified replacement character |
|
static java.lang.String |
replaceWhitespace(java.lang.String src,
java.lang.String repStr)
Replaces all whitespace found in the input String with the specified replacement String |
|
static java.lang.String |
replicateString(java.lang.String pattern,
int count)
Returns a String containing the 'pattern' String replicated 'count' times. |
|
static java.lang.String |
reverse(java.lang.String s)
Reverses the order of the characters in the specified String |
|
static java.lang.String |
rightAlign(long s,
int len)
Pads the input Long on the left with specified number of ' ' characters. |
|
static java.lang.String |
rightAlign(java.lang.String s,
int len)
Pads the input String on the left with specified number of ' ' characters. |
|
static java.lang.String |
rightJustify(long s,
int len)
See StringTools.rightAlign(long,int) |
|
static java.lang.String |
rightJustify(java.lang.String s,
int len)
See StringTools.rightAlign(String,int) |
|
static java.lang.String |
setFirstUpperCase(java.lang.String s)
Sets the first character of the beginning of each new word in the specified String to upper-case, and sets the remaining characters in each word to lower-case. |
|
static java.lang.String[] |
split(byte[] value,
char delim)
Converts the specified byte array to a String, then splits the resulting String per "StringTools.parseStringArray". |
|
static java.lang.String[] |
split(byte[] value,
char delim,
boolean trim)
Converts the specified byte array to a String, then splits the resulting String per "StringTools.parseStringArray". |
|
static java.lang.String[] |
split(java.lang.StringBuffer value,
char delim)
See StringTools.parseStringArray(StringBuffer, char) |
|
static java.lang.String[] |
split(java.lang.StringBuffer value,
char delim,
boolean trim)
See StringTools.parseStringArray(StringBuffer, char, boolean) |
|
static java.lang.String[] |
split(java.lang.String value,
char delim)
See StringTools.parseStringArray(String, char) |
|
static java.lang.String[] |
split(java.lang.String value,
char delim,
boolean trim)
See StringTools.parseStringArray(String, char, boolean) |
|
static boolean |
startsWith(byte[] b,
java.lang.String p)
Returns true if the specified byte array starts with the pattern String |
|
static boolean |
startsWith(byte[] b,
java.lang.String[] ap)
Returns true if the specified byte array starts with any of the specified pattern Strings |
|
static boolean |
startsWith(java.lang.String t,
java.lang.String p)
Returns true if the specified target String starts with the pattern String |
|
static boolean |
startsWith(java.lang.String t,
java.lang.String[] ap)
Returns true if the specified target String starts with any of the specified pattern Strings |
|
static boolean |
startsWithIgnoreCase(java.lang.String t,
java.lang.String p)
Returns true if the specified target String starts with the pattern String without regard to case (a method that should be on the String class itself, but isn't) |
|
static boolean |
startsWithIgnoreCase(java.lang.String t,
java.lang.String[] ap)
Returns true if the specified target String starts with any of the specified pattern Strings without regard to case. |
|
static java.lang.String |
stripChars(java.lang.String src,
char ch)
Strips the specified character from the input String |
|
static java.lang.String |
stripChars(java.lang.String src,
char[] chars)
Strips the specified characters from the input String |
|
static java.lang.String |
stripChars(java.lang.String src,
char ch,
int stripType)
Strips the specified character from the input String |
|
static java.lang.String |
stripChars(java.lang.String src,
java.lang.String chars)
Strips the specified characters from the input String |
|
static java.lang.String |
stripChars(java.lang.String src,
java.lang.String chars,
int stripType)
Strips the specified characters from the input String |
|
static java.lang.String[] |
toArray(java.util.List list)
Converts a list of Objects to an array of Strings |
|
static java.lang.String |
toBinaryString(byte b)
Converts the specified byte to a String binary representation |
|
static java.lang.String |
toBinaryString(byte[] b)
Converts the specified byte array to a String binary representation |
|
static java.lang.String |
toBinaryString(byte[] b,
int ofs,
int len)
Converts the specified byte array to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(byte[] b,
int ofs,
int len,
java.lang.StringBuffer sb)
Converts the specified byte array to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(byte[] b,
java.lang.StringBuffer sb)
Converts the specified byte array to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(byte b,
java.lang.StringBuffer sb)
Converts the specified byte to a String binary representation |
|
static java.lang.String |
toBinaryString(int i)
Converts the specified int to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(int i,
java.lang.StringBuffer sb)
Converts the specified int to a String binary representation |
|
static java.lang.String |
toBinaryString(long i)
Converts the specified int to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(long i,
int bc,
java.lang.StringBuffer sb)
Converts the specified int to a String binary representation |
|
static java.lang.StringBuffer |
toBinaryString(long i,
java.lang.StringBuffer sb)
Converts the specified int to a String binary representation |
|
static java.lang.String |
toHexString(java.math.BigInteger val)
Converts the specified long value to a hex representation |
|
static java.lang.String |
toHexString(java.math.BigInteger val,
int bitLen)
Converts the specified BigInteger value to a hex representation |
|
static java.lang.String |
toHexString(byte b)
Converts the specified byte to a String hex representation |
|
static java.lang.String |
toHexString(byte[] b)
Converts the specified byte array to a String hex representation |
|
static java.lang.String |
toHexString(byte[] b,
int ofs,
int len)
Converts the specified byte array to a String hex representation |
|
static java.lang.StringBuffer |
toHexString(byte[] b,
int ofs,
int len,
java.lang.StringBuffer sb)
Converts the specified byte array to a String hex representation |
|
static java.lang.StringBuffer |
toHexString(byte[] b,
java.lang.StringBuffer sb)
Converts the specified byte array to a String hex representation |
|
static java.lang.StringBuffer |
toHexString(byte b,
java.lang.StringBuffer sb)
Converts the specified byte to a String hex representation |
|
static java.lang.String |
toHexString(int val)
Converts the specified int value to a hex representation |
|
static java.lang.String |
toHexString(int val,
int bitLen)
Converts the specified long value to a hex representation |
|
static java.lang.String |
toHexString(long val)
Converts the specified long value to a hex representation |
|
static java.lang.String |
toHexString(long val,
int bitLen)
Converts the specified long value to a hex representation |
|
static java.lang.String |
toHexString(java.lang.Number val)
Converts the specified short value to a hex representation |
|
static java.lang.String |
toHexString(java.lang.Number val,
int bitLen)
Converts the specified short value to a hex representation |
|
static java.lang.String |
toHexString(short val)
Converts the specified short value to a hex representation |
|
static java.lang.String |
toString(byte v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(byte[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(char v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(char[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(double v)
Returns a String representation of the specified value. (used for debug logging) |
|
static java.lang.String |
toString(double[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(float v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(float[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(int v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(int[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(long v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(long[] v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toString(java.lang.Object v)
Returns a String representation of the specified value. (used for debug logging) |
|
static java.lang.String |
toString(java.lang.Object[] v)
Returns a String representation of the specified value. (used for debug logging) |
|
static java.lang.String |
toString(short v)
Returns a String representation of the specified value (used for debug logging) |
|
static java.lang.String |
toStringValue(byte[] b)
Converts the specified byte array to a String based on the default character set. |
|
static java.lang.String |
toStringValue(byte[] b,
char repUnp)
Converts the specified byte array to a String based on the default character set, replacing any unprintable characters. |
|
static java.lang.String |
toStringValue(byte[] b,
int ofs)
Converts the specified byte array to a String based on the default character set. |
|
static java.lang.String |
toStringValue(byte[] b,
int ofs,
int len)
Converts the specified byte array to a String based on the default character set. |
|
static java.lang.String |
toStringValue(byte[] b,
int ofs,
int len,
char repUnp)
Converts the specified byte array to a String based on the default character set. |
|
static java.lang.String |
toStringValue(char[] c)
Converts the specified character array to a String. |
|
static java.lang.String |
toStringValue(java.lang.String s,
char repUnp)
Converts the specified String to a String based on the default character set, replacing any unprintable characters. |
|
static java.lang.String |
toUTF16String(byte[] b)
Converts the specified byte array to a String based on the default character set. |
|
static byte[] |
toUTF8Bytes(byte[] b)
Converts the specified byte array to a String based on the UTF-8 character set. |
|
static java.lang.String |
trim(java.lang.Object obj)
Trims the leading/trailing blanks from the String representation of the specified Object argument. |
|
static java.lang.String |
trim(java.lang.String str)
Trims the leading/trailing blanks from the specified String argument. Similar to the String 'trim()' method with the addition that if the argument is null, a non-null empty String will be returned. |
|
static java.lang.String |
trim(java.lang.StringBuffer sb)
Trims the leading/trailing blanks from the specified StringBuffer argument. Similar to the String 'trim()' method with the addition that if the argument is null, a non-null empty String will be returned. |
|
static java.lang.String |
trimLeading(java.lang.Object s)
Trims the leading spaces from the string value of the input object |
|
static java.lang.String |
trimLeading(java.lang.String s)
Trims the leading spaces from the input string |
|
static java.lang.String |
trimLeading(java.lang.String s,
char c)
Trims the specified leading character from the input string |
|
static java.lang.String |
trimTrailing(java.lang.Object s)
Trims the trailing spaces from the string value of the input object |
|
static java.lang.String |
trimTrailing(java.lang.String s)
Trims the trailing spaces from the input string |
|
static java.lang.String |
trimTrailing(java.lang.String s,
char c)
Trims the specified trailing character from the input string |
|
static java.lang.String |
trimTrailingComments(java.lang.String S,
java.lang.String C)
Remove trailing comments from the rows in the specified string. |
|
static java.lang.String |
truncate(java.lang.String s,
int maxLen)
Truncates the specified string to the specified length. |
|
static java.lang.String |
unescapeChars(java.lang.String text)
Replace all "\\n" with "\n". Replace all "\\r" with "\r". Replace all "\\t" with "\t". |
|
static java.lang.String |
unescapeUnicode(java.lang.String u)
Converts the specified String to a Unicode encoded String. That is, convert unicode ' ' escapes characters sequences into the unicode character. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char BACKSPACE
public static final char FORM_FEED
public static final char NEW_LINE
public static final char CARRIAGE_RETURN
public static final char TAB
public static final java.lang.String WhitespaceChars
public static final char KeyValSeparatorEQUAL
public static final char KeyValSeparatorCOLON
public static final char KeyValSeparatorChar
public static final char[] KeyValSeparatorChars
public static final char PropertySeparatorSPACE
public static final char PropertySeparatorSEMIC
public static final char PropertySeparatorChar
public static final java.lang.String STRING_TRUE
public static final java.lang.String STRING_FALSE
public static final java.lang.String FORMAT_DATE
public static final java.lang.String FORMAT_DATE2
public static final java.lang.String FORMAT_TIME
public static final java.lang.String CharEncoding_UTF_8
public static final java.lang.String CharEncoding_UTF_16
public static final java.lang.String CharEncoding_8859_1
public static final java.lang.String CharEncoding_US_ASCII
public static final java.lang.String HEX
public static final java.lang.String ArraySeparator
public static final char ARRAY_DELIM
public static final char ARRAY_DOUBLE_QUOTE
public static final char ARRAY_SINGLE_QUOTE
public static final char ARRAY_QUOTE
public static final int STRIP_INCLUDE
public static final int STRIP_EXCLUDE
public static final char KEY_START_ESC
public static final java.lang.String KEY_START
public static final java.lang.String KEY_END
public static final java.lang.String DFT_DELIM
public static final java.lang.String ARG_DELIM
public static final int ELAPSED_FORMAT_SS
public static final int ELAPSED_FORMAT_HHMMSS
public static final int ELAPSED_FORMAT_HHMM
public static final int ELAPSED_FORMAT_HHHhh
public static final int ELAPSED_FORMAT_HHHh
public static final int ELAPSED_FORMAT_MMMSS
public static final java.lang.String HTML_SP
public static final java.lang.String HTML_LT
public static final java.lang.String HTML_GT
public static final java.lang.String HTML_AMP
public static final java.lang.String HTML_DEG
public static final java.lang.String HTML_QUOTE
public static final java.lang.String HTML_DOUBLE_QUOTE
public static final java.lang.String HTML_APOS
public static final java.lang.String HTML_SINGLE_QUOTE
public static final java.lang.String HTML_br
public static final java.lang.String HTML_BR
public static final java.lang.String HTML_HR
Constructor Detail |
---|
public StringTools()
Method Detail |
---|
public static java.lang.String getCharacterEncoding()
public static java.lang.String[] getCharacterEncodings()
public static int length(java.lang.String s)
s
- The String (may be null)
public static java.lang.String truncate(java.lang.String s, int maxLen)
s
- The StringmaxLen
- The maximum length
public static char[] getChars(java.lang.String s)
s
- The String from which the char array will be returned
public static char[] getChars(byte[] b)
b
- The array of bytes to convert to characters
public static byte[] getBytes(java.lang.StringBuffer sb)
StringTools.getCharacterEncoding()
)
sb
- The StringBuffer which will be converted to a byte array
public static byte[] getBytes(java.lang.String s)
StringTools.getCharacterEncoding()
)
s
- The String which will be converted to a byte array
public static byte[] getBytes(char[] c)
c
- The char array which will be converted to a byte array
public static byte[] getBytesHex(java.lang.String s)
s
- The String which will be converted to a byte array
public static boolean isValidID(java.lang.String s, char... x)
s
- The String tested for alpha-numeric charactersx
- Other valid characters allowed in the target string
public static boolean isNumeric(java.lang.Object n)
n
- The String tested for decimal numeric characters
public static boolean isNumeric(java.lang.Object n, boolean inclHex)
n
- The String tested for decimal numeric charactersinclHex
- True to include the A..F hex characters
public static boolean isNumeric(java.lang.String s)
s
- The String tested for decimal numeric characters
public static boolean isNumeric(java.lang.String s, boolean inclHex)
s
- The String tested for numeric charactersinclHex
- True to include the A..F hex characters
public static boolean isAlphaNumeric(java.lang.String s, boolean inclSpace)
s
- The String tested for alpha-numeric charactersinclSpace
- True to include the space (" ") character as well
public static boolean isAlphaNumeric(java.lang.String s, char... x)
s
- The String tested for alpha-numeric charactersx
- Other valid characters allowed in the target string
public static boolean isAlphaNumeric(byte[] b)
b
- The byte array tested for AlphaNumeric
public static boolean isAlphaNumeric(byte[] b, int ofs)
b
- The byte array tested for AlphaNumeric
public static boolean isAlphaNumeric(byte[] b, int ofs, int len)
b
- The byte array tested for AlphaNumericofs
- The offset within the array to begin testinglen
- The number of elements to test within the array
public static boolean isPrintableASCII(byte[] b)
b
- The byte array tested for printable ASCII
public static boolean isPrintableASCII(byte[] b, boolean inclSpace)
b
- The byte array tested for printable ASCIIinclSpace
- True to include space characters (' ', '\t', '\n', '\r'), false to omit.
public static boolean isPrintableASCII(byte[] b, int ofs, int len, boolean inclSpace)
b
- The byte array tested for printable ASCIIofs
- The offset within the array to begin testinglen
- The number of elements to test within the arrayinclSpace
- True to include space characters (' ', '\t', '\n', '\r'), false to omit.
public static java.lang.String toStringValue(java.lang.String s, char repUnp)
s
- The String to convert to a printable String, based on the default character set.repUnp
- The character used to replace any detected unprintable characters.
public static java.lang.String toStringValue(byte[] b, char repUnp)
b
- The byte array to convert to a String, based on the default character set.repUnp
- The character used to replace any detected unprintable characters.
public static java.lang.String toStringValue(byte[] b)
b
- The byte array to convert to a String, based on the default character set.
public static java.lang.String toStringValue(byte[] b, int ofs)
b
- The byte array to convert to a String, based on the default character set.ofs
- The offset within the byte array to convert to a String
public static java.lang.String toStringValue(byte[] b, int ofs, int len, char repUnp)
b
- The byte array to convert to a String, based on the default character set.ofs
- The offset within the byte array to convert to a Stringlen
- The number of bytes starting at the specified offset to convert to a StringrepUnp
- The character used to replace any detected unprintable characters.
public static java.lang.String toStringValue(byte[] b, int ofs, int len)
b
- The byte array to convert to a String, based on the default character set.ofs
- The offset within the byte array to convert to a Stringlen
- The number of bytes starting at the specified offset to convert to a String
public static java.lang.String toStringValue(char[] c)
c
- The char array to convert to a String
public static java.lang.String toString(java.lang.Object v)
v
- The value
public static java.lang.String toString(java.lang.Object[] v)
v
- The value
public static java.lang.String toString(double v)
v
- The value
public static java.lang.String toString(double[] v)
v
- The value
public static java.lang.String toString(float v)
v
- The value
public static java.lang.String toString(float[] v)
v
- The value
public static java.lang.String toString(long v)
v
- The value
public static java.lang.String toString(long[] v)
v
- The value
public static java.lang.String toString(int v)
v
- The value
public static java.lang.String toString(int[] v)
v
- The value
public static java.lang.String toString(short v)
v
- The value
public static java.lang.String toString(byte v)
v
- The value
public static java.lang.String toString(byte[] v)
v
- The value
public static java.lang.String toString(char v)
v
- The value
public static java.lang.String toString(char[] v)
v
- The value
public static byte[] toUTF8Bytes(byte[] b)
b
- The byte array to convert to a String, based on the UTF-8 character set.
public static java.lang.String toUTF16String(byte[] b)
b
- The byte array to convert to a String, based on the default character set.
public static java.lang.String escapeJSON(java.lang.String s)
s
- The String to convert to a JSON encoded String
public static java.lang.String escapeUnicode(java.lang.String s)
s
- The String to convert to a Unicode encoded String
public static java.lang.String unescapeUnicode(java.lang.String u)
u
- The Unicode escaped ASCII String to convert to unicode character String
public static java.lang.String trim(java.lang.StringBuffer sb)
sb
- The StringBuffer to trim, or null to return an empty String
public static java.lang.String trim(java.lang.Object obj)
obj
- The Object String to trim, or null to return an empty String
public static java.lang.String trim(java.lang.String str)
str
- The String to trim, or null to return an empty String
public static boolean isBlank(java.lang.String s)
s
- The String to test for blank.
public static boolean isBlank(java.lang.StringBuffer s)
s
- The StringBuffer to test for blank.
public static boolean isBlank(java.lang.Object s)
s
- The Object to test for blank.
public static java.lang.String blankDefault(java.lang.Object target, java.lang.String dft)
target
- The specified target Stringdft
- The default String
public static java.lang.String blankDefault(java.lang.String target, java.lang.String dft)
target
- The specified target Stringdft
- The default String
public static boolean equals(java.lang.String s1, java.lang.String s2)
public static boolean equalsIgnoreCase(java.lang.String s1, java.lang.String s2)
public static java.lang.String trimLeading(java.lang.String s, char c)
s
- The input Stringc
- The leading character to trimpublic static java.lang.String trimLeading(java.lang.String s)
s
- The input Stringpublic static java.lang.String trimLeading(java.lang.Object s)
s
- The input objectpublic static java.lang.String trimTrailing(java.lang.String s, char c)
s
- The input Stringc
- The trailing character to trimpublic static java.lang.String trimTrailing(java.lang.String s)
s
- The input Stringpublic static java.lang.String trimTrailing(java.lang.Object s)
s
- The input objectpublic static java.lang.String reverse(java.lang.String s)
s
- The input String from which the returned String will be reversed.
public static java.lang.String quoteString(java.lang.String s)
s
- The String to quote
public static java.lang.String quoteString(java.lang.String s, char q)
s
- The String to quoteq
- The quote character to use to quote the String
public static java.lang.String quoteCSVString(java.lang.String s)
s
- The String to quote
public static java.lang.String encodeCSV(java.lang.String[] d, boolean checkTextQuote)
d
- The array of Strings to encode into a CSV linecheckTextQuote
- Set true to prefix values with a "'" tick (required by Excel?)
public static java.lang.String encodeCSV(java.lang.String[] d)
d
- The array of Strings to encode into a CSV line
public static java.lang.String parseQuote(java.lang.String s)
s
- The quoted String to parse
public static int parseQuote(char[] ch, int a, java.lang.StringBuffer sb)
ch
- The quoted char array to parsea
- The starting index within the char array to begin parsingsb
- The destination where the parsed un-quoted String is placed
public static <T> java.lang.Number parseNumber(java.lang.Object data, java.lang.Class<?> numberClass, java.lang.Number dft)
data
- The object to parsedft
- The default Number value if unable to parse the specified object
public static double parseDouble(byte[] b, int ofs, boolean isBigEndian, double dft)
b
- The byte array to parseofs
- The offset within the byte array to begin parsingisBigEndian
- True if the IEEE 754 with the byte array in in BigEndian orderdft
- The default double returned if unable to parse a double value
public static double[] parseDouble(java.lang.Object[] data, double dft)
data
- The Object array to parsedft
- The default values used if unable to parse a specific entry in the Object array
public static double parseDouble(java.lang.Object data, double dft)
data
- The object to parsedft
- The default double value if unable to parse the specified object
public static double parseDouble(java.lang.String data, double dft)
data
- The String to parsedft
- The default double value if unable to parse the specified object
public static double parseDouble(StringTools.FilterNumber num, double dft)
num
- The FilterNumber to parsedft
- The default double value if unable to parse the specified object
public static boolean isDouble(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict double value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isDouble(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict double value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static float parseFloat(byte[] b, int ofs, boolean isBigEndian, float dft)
b
- The byte array to parseofs
- The offset within the byte array to begin parsingisBigEndian
- True if the IEEE 754 with the byte array in in BigEndian orderdft
- The default float returned if unable to parse a float value
public static float parseFloat(java.lang.Object data, float dft)
data
- The object to parsedft
- The default float value if unable to parse the specified object
public static float parseFloat(java.lang.String data, float dft)
data
- The String to parsedft
- The default float value if unable to parse the specified object
public static float parseFloat(StringTools.FilterNumber num, float dft)
num
- The FilterNumber to parsedft
- The default float value if unable to parse the specified object
public static boolean isFloat(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict float value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isFloat(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict float value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static long[] parseLong(java.lang.Object[] data, long dft)
data
- The Object array to parsedft
- The default values used if unable to parse a specific entry in the Object array
public static long parseLong(java.lang.Object data, long dft)
data
- The object to parsedft
- The default long value if unable to parse the specified object
public static long parseLong(java.lang.String data, long dft)
data
- The String to parsedft
- The default long value if unable to parse the specified object
public static long parseLong(StringTools.FilterNumber num, long dft)
num
- The FilterNumber to parsedft
- The default long value if unable to parse the specified object
public static long parseLong(byte[] b, int ofs, int len, boolean isBigEndian, boolean signed, long dft)
b
- The byte array to parseofs
- The offset within the byte array to begin parsinglen
- The number of bytes to decode into the long valueisBigEndian
- True if the value with the byte array in in BigEndian ordersigned
- If the encoded bytes represent a signed valuedft
- The default long returned if unable to parse a long value
public static boolean isLong(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict long value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isLong(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict long value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static int[] parseInt(java.lang.Object[] data, int dft)
data
- The Object array to parsedft
- The default values used if unable to parse a specific entry in the Object array
public static int parseInt(java.lang.Object data, int dft)
data
- The object to parsedft
- The default int value if unable to parse the specified object
public static int parseInt(java.lang.String data, int dft)
data
- The String to parsedft
- The default int value if unable to parse the specified object
public static int parseInt(StringTools.FilterNumber num, int dft)
num
- The FilterNumber to parsedft
- The default int value if unable to parse the specified object
public static int parseInt(byte[] b, int ofs, int len, boolean isBigEndian, boolean signed, int dft)
b
- The byte array to parseofs
- The offset within the byte array to begin parsinglen
- The number of bytes to decode into the int valueisBigEndian
- True if the value with the byte array in in BigEndian ordersigned
- If the encoded bytes represent a signed valuedft
- The default int returned if unable to parse an int value
public static boolean isInt(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict int value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isInt(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict int value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static short parseShort(java.lang.Object data, short dft)
data
- The object to parsedft
- The default short value if unable to parse the specified object
public static short parseShort(java.lang.String data, short dft)
data
- The String to parsedft
- The default short value if unable to parse the specified object
public static short parseShort(StringTools.FilterNumber num, short dft)
num
- The FilterNumber to parsedft
- The default short value if unable to parse the specified object
public static boolean isShort(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict short value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isShort(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict short value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static java.math.BigInteger parseBigInteger(java.lang.Object data, java.math.BigInteger dft)
data
- The object to parsedft
- The default BigInteger value if unable to parse the specified object
public static java.math.BigInteger parseBigInteger(java.lang.String data, java.math.BigInteger dft)
data
- The String to parsedft
- The default BigInteger value if unable to parse the specified object
public static java.math.BigInteger parseBigInteger(StringTools.FilterNumber num, java.math.BigInteger dft)
num
- The FilterNumber to parsedft
- The default BigInteger value if unable to parse the specified object
public static boolean isBigInteger(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict BigInteger value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isBigInteger(java.lang.Object data, boolean strict)
data
- The Object to teststrict
- True to test for a strict BigInteger value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean parseBoolean(java.lang.Object data, boolean dft)
data
- The object to parsedft
- The default boolean value if unable to parse the specified object
public static boolean parseBoolean(java.lang.String data, boolean dft)
data
- The String to parsedft
- The default boolean value if unable to parse the specified object
public static boolean isBoolean(java.lang.String data, boolean strict)
data
- The String to teststrict
- True to test for a strict boolean value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static boolean isBoolean(java.lang.Object data, boolean strict)
data
- The String to teststrict
- True to test for a strict boolean value (ie. does not contain
any other superfluous trailing characters), false to allow for
other non-critical trailing characters.
public static java.lang.String parseString(java.lang.Object data, java.lang.String dft)
data
- The object to parsedft
- The default String value if unable to parse the specified Object
public static java.lang.String parseString(byte[] data, java.lang.String dft)
data
- The byte array to parsedft
- The default String value if unable to parse the specified byte array
public static java.lang.String parseString(byte[] data, int ofs, java.lang.String dft)
data
- The byte array to parseofs
- The offset into the byte array to begin parsingdft
- The default String value if unable to parse the specified byte array
public static java.awt.Dimension parseDimension(java.lang.String data, java.awt.Dimension dft)
data
- The String object to parsedft
- The default Dimension object if unable to parse the String
public static boolean isHexDigit(char ch)
ch
- The character containing the hex digit to test
public static boolean isHexDigit(byte b)
b
- The byte containing the ASCII hex digit to test
public static int hexIndex(char ch)
ch
- The hex character to return the value
public static char hexNybble(byte nybble)
nybble
- The value to convert to a hex character. Only the least significant
nybble of this byte will be used to convert to the hex character.
public static char hexNybble(int nybble)
nybble
- The value to convert to a hex character. Only the least significant
nybble of this byte will be used to convert to the hex character.
public static byte[] parseHex(java.lang.String data, byte[] dft)
data
- The String containing the hex character valuesdft
- The default byte array return if unable to convert the specified String value
public static java.lang.String parseHexAscii(java.lang.String data, java.lang.String dft)
data
- The String hex representation to convert to a Stringdft
- The default String value to return if unable to convert the specified String hex representation.
public static short parseHex(java.lang.String data, short dft)
data
- The String hex representation to convert to a Stringdft
- The default short value to return if unable to convert the specified String hex representation.
public static short parseHexShort(java.lang.String data, short dft)
data
- The String hex representation to convert to a Stringdft
- The default short value to return if unable to convert the specified String hex representation.
public static int parseHex(java.lang.String data, int dft)
data
- The String hex representation to convert to a Stringdft
- The default int value to return if unable to convert the specified String hex representation.
public static int parseHexInt(java.lang.String data, int dft)
data
- The String hex representation to convert to a Stringdft
- The default int value to return if unable to convert the specified String hex representation.
public static long parseHex(java.lang.String data, long dft)
data
- The String hex representation to convert to a Stringdft
- The default long value to return if unable to convert the specified String hex representation.
public static long parseHexLong(java.lang.String data, long dft)
data
- The String hex representation to convert to a Stringdft
- The default long value to return if unable to convert the specified String hex representation.
public static int hexLength(java.lang.String data)
data
- The String containing the hex representation
public static boolean isHex(java.lang.String data, boolean strict)
data
- The String representation of the hex characters to teststrict
- True to check for strict hex character values, false to allow for
trailing superfluous characters.
public static java.lang.StringBuffer formatHexString(byte[] b)
b
- The byte array to convert to a String representation
public static java.lang.StringBuffer formatHexString(byte[] b, int blockLen)
b
- The byte array to convert to a String representationblockLen
- The number of bytes display on a single row.
public static java.lang.StringBuffer formatHexString(byte[] b, int blockLen, java.lang.StringBuffer sb)
b
- The byte array to convert to a String representationblockLen
- The number of bytes display on a single rowsb
- The destination ouput StringBuffer
public static java.lang.StringBuffer formatHexString(byte[] b, int bOfs, int bLen, int blockLen, boolean showAscii, java.lang.StringBuffer sb)
b
- The byte array to convert to a String representationbOfs
- The starting index where the byte array contents will be dipsplayedbLen
- The number of byte to display from the specified byte arrayblockLen
- The number of bytes display on a single rowshowAscii
- True to display thesb
- The destination ouput StringBuffer
public static java.lang.StringBuffer toHexString(byte b, java.lang.StringBuffer sb)
b
- The byte to convert to a String hex representationsb
- The destination StringBuffer where the hex String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toHexString(byte b)
b
- The byte to convert to a String hex representation
public static java.lang.StringBuffer toHexString(byte[] b, int ofs, int len, java.lang.StringBuffer sb)
b
- The byte array to convert to a String hex representationofs
- The offset into the byte array to start the hex conversionlen
- The number of bytes to convert to hexsb
- The destination StringBuffer where the hex String is placed. If
null, a new StringBuffer will be created.
public static java.lang.StringBuffer toHexString(byte[] b, java.lang.StringBuffer sb)
b
- The byte array to convert to a String hex representationsb
- The destination StringBuffer where the hex String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toHexString(byte[] b)
b
- The byte array to convert to a String hex representation
public static java.lang.String toHexString(byte[] b, int ofs, int len)
b
- The byte array to convert to a String hex representationofs
- The offset into the byte array to start the hex conversionlen
- The number of bytes to convert to hex
public static java.lang.String toHexString(java.math.BigInteger val, int bitLen)
val
- The BigInteger value to convert to hexbitLen
- The length of significant bits to include in the hex representation
public static java.lang.String toHexString(java.math.BigInteger val)
val
- The long value to convert to hex
public static java.lang.String toHexString(int val, int bitLen)
val
- The long value to convert to hexbitLen
- The length of significant bits to include in the hex representation
public static java.lang.String toHexString(long val, int bitLen)
val
- The long value to convert to hexbitLen
- The length of significant bits to include in the hex representation
public static java.lang.String toHexString(long val)
val
- The long value to convert to hex
public static java.lang.String toHexString(int val)
val
- The int value to convert to hex
public static java.lang.String toHexString(short val)
val
- The short value to convert to hex
public static java.lang.String toHexString(java.lang.Number val)
val
- The short value to convert to hex
public static java.lang.String toHexString(java.lang.Number val, int bitLen)
val
- The short value to convert to hex
public static java.lang.StringBuffer toBinaryString(byte[] b, int ofs, int len, java.lang.StringBuffer sb)
b
- The byte array to convert to a String binary representationofs
- The offset into the byte array to start the binary conversionlen
- The number of bytes to convert to binarysb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.StringBuffer toBinaryString(byte[] b, java.lang.StringBuffer sb)
b
- The byte array to convert to a String binary representationsb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toBinaryString(byte[] b)
b
- The byte array to convert to a String binary representation
public static java.lang.String toBinaryString(byte[] b, int ofs, int len)
b
- The byte array to convert to a String binary representationofs
- The offset into the byte array to start the binary conversionlen
- The number of bytes to convert to binary
public static java.lang.StringBuffer toBinaryString(byte b, java.lang.StringBuffer sb)
b
- The byte to convert to a String binary representationsb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toBinaryString(byte b)
b
- The byte to convert to a String binary representation
public static java.lang.StringBuffer toBinaryString(int i, java.lang.StringBuffer sb)
i
- The int to convert to a String binary representationsb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toBinaryString(int i)
i
- The int to convert to a String binary representation
public static java.lang.StringBuffer toBinaryString(long i, int bc, java.lang.StringBuffer sb)
i
- The 'long' to convert to a String binary representationbc
- The bit-count to returnsb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.StringBuffer toBinaryString(long i, java.lang.StringBuffer sb)
i
- The 'long' to convert to a String binary representationsb
- The destination StringBuffer where the binary String is placed. If
null, a new StringBuffer will be created.
public static java.lang.String toBinaryString(long i)
i
- The 'long' to convert to a String binary representation
public static java.lang.String setFirstUpperCase(java.lang.String s)
s
- The String to convert to upper/lower case characters
public static boolean startsWith(byte[] b, java.lang.String p)
b
- The byte arrayp
- The pattern String
public static boolean startsWith(byte[] b, java.lang.String[] ap)
b
- The byte arrayap
- An array of pattern Strings
public static boolean startsWith(java.lang.String t, java.lang.String p)
t
- The target Stringp
- The pattern String
public static boolean startsWith(java.lang.String t, java.lang.String[] ap)
t
- The target Stringap
- An array of pattern Strings
public static boolean startsWithIgnoreCase(java.lang.String t, java.lang.String p)
t
- The target Stringp
- The pattern String
public static boolean startsWithIgnoreCase(java.lang.String t, java.lang.String[] ap)
t
- The target Stringap
- An array of pattern Strings
public static boolean endsWith(java.lang.String t, java.lang.String p)
t
- The target Stringp
- The pattern String
public static boolean endsWithIgnoreCase(java.lang.String t, java.lang.String p)
t
- The target Stringp
- The pattern String
public static boolean endsWithIgnoreCase(java.lang.String t, java.lang.String[] p)
t
- The test Stringp
- An array of pattern Strings
public static int indexOfIgnoreCase(java.lang.String t, java.lang.String p)
t
- The test Stringp
- The pattern String
public static int indexOfIgnoreCase(java.lang.String tt, java.lang.String[] pp)
tt
- The target Stringpp
- The array of pattern Strings
public static int indexOf(java.lang.String t, java.lang.String p)
t
- The target String (may be null)p
- The pattern String
public static int indexOf(java.lang.String t, char c)
t
- The target String (may be null)c
- The pattern character
public static int indexOf(java.lang.String t, int n, java.lang.String p)
t
- The target String (may be null)n
- The starting indexp
- The pattern String (moved to the end to allow for multiple pattern specifications)
public static int indexOf(java.lang.String t, int n, char c)
t
- The target String (may be null)n
- The starting indexc
- The pattern character (moved to the end to allow for multiple pattern specifications)
public static int indexOf(java.lang.String tt, java.lang.String... pp)
tt
- The target String (may be null)pp
- The array of pattern Strings
public static int indexOf(java.lang.String tt, char... cc)
tt
- The target String (may be null)cc
- The array of pattern characters
public static int indexOf(java.lang.String tt, int n, java.lang.String... pp)
tt
- The target String (may be null)n
- The starting indexpp
- The array of pattern Strings (moved to the end to allow for multiple pattern specifications)
public static int indexOf(java.lang.String tt, int n, char... cc)
tt
- The target String (may be null)n
- The starting indexcc
- The array of pattern characters (moved to the end to allow for multiple pattern specifications)
public static int lastIndexOf(java.lang.String t, java.lang.String p)
t
- The target String (may be null)p
- The pattern String
public static int lastIndexOf(java.lang.String t, char c)
t
- The target String (may be null)c
- The pattern character
public static int lastIndexOf(java.lang.String t, int n, java.lang.String p)
t
- The target String (may be null)n
- The starting indexp
- The pattern String (moved to the end to allow for multiple pattern specifications)
public static int lastIndexOf(java.lang.String t, int n, char c)
t
- The target String (may be null)n
- The starting indexc
- The pattern character (moved to the end to allow for multiple pattern specifications)
public static int lastIndexOf(java.lang.String tt, java.lang.String... pp)
tt
- The target String (may be null)pp
- The array of pattern Strings
public static int lastIndexOf(java.lang.String tt, char... cc)
tt
- The target String (may be null)cc
- The array of pattern characters
public static int lastIndexOf(java.lang.String tt, int n, java.lang.String... pp)
tt
- The target String (may be null)n
- The starting indexpp
- The array of pattern Strings (moved to the end to allow for multiple pattern specifications)
public static int lastIndexOf(java.lang.String tt, int n, char... cc)
tt
- The target String (may be null)n
- The starting indexcc
- The array of pattern characters (moved to the end to allow for multiple pattern specifications)
public static boolean contains(java.lang.String t, java.lang.String m)
t
- The target Stringm
- The pattern String
public static boolean containsIgnoreCase(java.lang.String t, java.lang.String m)
t
- The target Stringm
- The pattern String
public static int indexOf(char[] A, char c)
A
- The character arrayc
- The pattern character
public static int indexOf(byte[] B, byte b)
B
- The byte arrayb
- The pattern byte
public static java.lang.String[] parseArray(java.lang.String s)
s
- The "," delimited String to parse
public static java.lang.String[] parseArray(java.lang.String s, char arrayDelim)
s
- The character delimited String to parsearrayDelim
- The character delimiter
public static java.lang.String encodeArray(java.lang.Object[] list, char delim, boolean alwaysQuote)
list
- The array of Strings/Objects to encodedelim
- The character delimteralwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.Object[] list, int ofs, int max, char delim, boolean alwaysQuote)
list
- The array of Strings/Objects to encodeofs
- The offset within list to begin encoding into the returned Stringmax
- The number of String fields to include from the specified listdelim
- The character delimteralwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.Object list, char delim, boolean alwaysQuote)
list
- The Object containing an array or list of Strings to encodedelim
- The character delimteralwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.Object list, int ofs, int max, char delim, boolean alwaysQuote)
list
- The Object containing an array or list of Strings to encodeofs
- The offset within list to begin encoding into the returned Stringmax
- The number of String fields to include from the specified listdelim
- The character delimteralwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.util.List<java.lang.Object> list, char delim, boolean alwaysQuote)
list
- The List containing the Strings to encodedelim
- The character delimteralwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.util.List<java.lang.Object> list)
list
- The List containing the Strings to encode
public static java.lang.String encodeArray(java.util.List<java.lang.Object> list, boolean alwaysQuote)
list
- The List containing the Strings to encodealwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.Object[] list)
list
- The array containing the Strings to encode
public static java.lang.String encodeArray(java.lang.Object[] list, boolean alwaysQuote)
list
- The array containing the Strings to encodealwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.String[] list)
list
- The array containing the Strings to encode
public static java.lang.String encodeArray(java.lang.String[] list, boolean alwaysQuote)
list
- The array containing the Strings to encodealwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String encodeArray(java.lang.Object list)
list
- The array containing the Strings to encode
public static java.lang.String encodeArray(java.lang.Object list, boolean alwaysQuote)
list
- The array containing the Strings to encodealwaysQuote
- True to always quote each String field. If false, a String field
will only be quoted if it contains embedded spaces or other characters
that need to be specified literally.\
public static java.lang.String[] toArray(java.util.List list)
list
- The list of objects to convert to an array of Strings
public static java.lang.String[] parseStringArray(java.lang.String value, char delim)
value
- The String to parsedelim
- The character delimiter
public static java.lang.String[] parseStringArray(java.lang.String value, java.lang.String sdelim)
value
- The String to parsesdelim
- The character delimiters (all characters in this String are considered
individual delimiter candidates)
public static java.lang.String[] parseStringArray(java.lang.StringBuffer value, char delim)
value
- The StringBuffer to parsedelim
- The character delimiter
public static java.lang.String[] parseStringArray(java.lang.StringBuffer value, java.lang.String sdelim)
value
- The StringBuffer to parsesdelim
- The character delimiters (all characters in this String are considered
individual delimiter candidates)
public static java.lang.String[] parseStringArray(java.lang.StringBuffer value, java.lang.String sdelim, boolean trim)
value
- The StringBuffer to parsesdelim
- The character delimiters (all characters in this String are considered
individual delimiter candidates)trim
- True to trim leading/trailing spaces
public static java.lang.String[] parseStringArray(java.lang.String value, java.lang.String sdelim, boolean trim)
value
- The String to parsesdelim
- The character delimiters (all characters in this String are considered
individual delimiter candidates)trim
- True to trim leading/trailing spaces
public static java.lang.String[] split(java.lang.String value, char delim)
public static java.lang.String[] split(java.lang.String value, char delim, boolean trim)
public static java.lang.String[] split(java.lang.StringBuffer value, char delim)
public static java.lang.String[] split(java.lang.StringBuffer value, char delim, boolean trim)
public static java.lang.String[] split(byte[] value, char delim)
public static java.lang.String[] split(byte[] value, char delim, boolean trim)
public static java.lang.String join(java.lang.String[] val, int ofs, char delim)
val
- The input String arrayofs
- The offset into 'val' to begin concatenationdelim
- The character delimiter
public static java.lang.String join(java.lang.String[] val, char delim)
val
- The input String arraydelim
- The character delimiter
public static java.lang.String join(java.lang.String[] val, int ofs, java.lang.String delim)
val
- The input String arrayofs
- The offset into 'val' to begin concatenationdelim
- The String delimiter
public static java.lang.String join(java.lang.String[] val, java.lang.String delim)
val
- The input String arraydelim
- The String delimiter
public static java.lang.String join(java.lang.Object[] val, int ofs, char delim)
val
- The input Object arrayofs
- The offset into 'val' to begin concatenationdelim
- The character delimiter
public static java.lang.String join(java.lang.Object[] val, char delim)
val
- The input Object arraydelim
- The character delimiter
public static java.lang.String join(java.lang.Object[] val, int ofs, java.lang.String delim)
val
- The input Object arrayofs
- The offset into 'val' to begin concatenationdelim
- The String delimiter
public static java.lang.String join(java.lang.Object[] val, java.lang.String delim)
val
- The input Object arraydelim
- The String delimiter
public static java.lang.String join(java.lang.Iterable<?> list, int ofs, char delim)
list
- The input object listofs
- The offset into 'list' to begin concatenationdelim
- The character delimiter
public static java.lang.String join(java.lang.Iterable<?> list, char delim)
list
- The input object listdelim
- The character delimiter
public static java.lang.String join(java.lang.Iterable<?> list, int ofs, java.lang.String delim)
list
- The input object listofs
- The offset into 'list' to begin concatenationdelim
- The String delimiter
public static java.lang.String join(java.lang.Iterable<?> list, java.lang.String delim)
list
- The input object listdelim
- The String delimiter
public static java.lang.String join(int[] val, char delim)
val
- The input int arraydelim
- The character delimiter
public static java.lang.String join(int[] val, java.lang.String delim)
val
- The input int arraydelim
- The String delimiter
public static java.lang.String join(long[] val, char delim)
val
- The input long arraydelim
- The character delimiter
public static java.lang.String join(long[] val, java.lang.String delim)
val
- The input long arraydelim
- The String delimiter
public static java.lang.String join(double[] val, char delim)
val
- The input double arraydelim
- The character delimiter
public static java.lang.String join(double[] val, java.lang.String delim)
val
- The input double arraydelim
- The String delimiter
public static java.lang.String join(float[] val, char delim)
val
- The input float arraydelim
- The character delimiter
public static java.lang.String join(float[] val, java.lang.String delim)
val
- The input float arraydelim
- The String delimiter
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props)
props
- The String containing the list of properties
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props, char propSep)
props
- The String containing the list of propertiespropSep
- The property separator charactor (ie. ' ', or ';')
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props, java.util.Map<java.lang.String,java.lang.String> properties)
props
- The String containing the list of propertiesproperties
- The map where the parsed properties will be placed. If null, a mew
map object will be created.
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props, char propSep, java.util.Map<java.lang.String,java.lang.String> properties)
props
- The String containing the list of propertiespropSep
- The property separator charactor (ie. ' ', or ';')properties
- The map where the parsed properties will be placed. If null, a mew
map object will be created.
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props, char propSep, char[] keyValSep)
props
- The String containing the list of propertiespropSep
- The property separator charactor (ie. ' ', or ';')keyValSep
- The key/value separator char (ie. '=' or ':')
public static java.util.Map<java.lang.String,java.lang.String> parseProperties(java.lang.String props, char propSep, char[] keyValSep, java.util.Map<java.lang.String,java.lang.String> properties)
props
- The String containing the list of propertiespropSep
- The property separator charactor (ie. ' ', or ';')keyValSep
- The key/value separator chars (ie. '=' or ':')properties
- The map where the parsed properties will be placed. If null, a mew
map object will be created.
public static java.lang.String stripChars(java.lang.String src, char[] chars)
src
- The input String from which the characters will be removedchars
- The list of characters which will be removed from the input String
public static java.lang.String stripChars(java.lang.String src, char ch)
src
- The input String from which the character will be removedch
- The character which will be removed from the input String
public static java.lang.String stripChars(java.lang.String src, java.lang.String chars)
src
- The input String from which the characters will be removedchars
- The String of characters which will be removed from the input String
public static java.lang.String stripChars(java.lang.String src, char ch, int stripType)
src
- The input String from which the character will be removedch
- The character which will be removed from the input StringstripType
- May be either STRIP_INCLUDE to include only the specified character,
or STRIP_EXCLUDE to exclude the specified character.
public static java.lang.String stripChars(java.lang.String src, java.lang.String chars, int stripType)
src
- The input String from which the characters will be removedchars
- The list of characters which will be removed from the input StringstripType
- May be either STRIP_INCLUDE to include only the specified characters,
or STRIP_EXCLUDE to exclude the specified characters.
public static java.lang.String trimTrailingComments(java.lang.String S, java.lang.String C)
S
- The input stringC
- The comment delimiter.
public static java.lang.String replaceChars(java.lang.String src, char ch, char repChar)
src
- The input Stringch
- The character to replacerepChar
- The replacement character
public static java.lang.String replaceChars(java.lang.String src, java.lang.String chars, char repChar)
src
- The input Stringchars
- The characters to replace (any character found in this String will be replaced)repChar
- The replacement character
public static java.lang.String replaceChars(java.lang.String src, java.lang.String chars, java.lang.String repStr)
src
- The input Stringchars
- The characters to replace (any character found in this String will be replaced)repStr
- The replacement String
public static java.lang.String replaceWhitespace(java.lang.String src, char repChar)
src
- The input StringrepChar
- The character used to replace whitespace characters
public static java.lang.String replaceWhitespace(java.lang.String src, java.lang.String repStr)
src
- The input StringrepStr
- The String used to replace whitespace characters
public static java.lang.String replaceKeys(java.lang.String text, StringTools.KeyValueMap keyMap)
text
- The text containing the "${key}" fieldskeyMap
- The KeyValueMap object used to retrieve values for the specific 'keys'public static java.lang.String replaceKeys(java.lang.String text, StringTools.KeyValueMap keyMap, StringTools.ValueFilter filter)
text
- The text containing the "${key}" fieldskeyMap
- The KeyValueMap object used to retrieve values for the specific 'keys'public static java.lang.String replaceKeys(java.lang.String text, StringTools.KeyValueMap keyMap, StringTools.ValueFilter filter, java.lang.String keyStart, java.lang.String keyEnd, java.lang.String argDelim, java.lang.String dftDelim)
text
- The text containing the "${key}" fieldskeyMap
- The KeyValueMap object used to retrieve values for the specific 'keys'public static java.lang.StringBuffer replaceKeys(java.lang.StringBuffer repText, StringTools.KeyValueMap keyMap, StringTools.ValueFilter filter, java.lang.String keyStart, java.lang.String keyEnd, java.lang.String argDelim, java.lang.String dftDelim, boolean replaceEsc)
repText
- The text containing the "${key}" fieldskeyMap
- The KeyValueMap object used to retrieve values for the specific 'keys'public static java.lang.String replicateString(java.lang.String pattern, int count)
pattern
- The pattern Stringcount
- The number of times to replicate the pattern Strin
public static java.lang.String padRight(java.lang.String s, char padChar, int len)
s
- The input StringpadChar
- The pad characterlen
- The length up to which pad characters will be appended
public static java.lang.String leftAlign(java.lang.String s, int len)
s
- The input Stringlen
- The length up to which ' ' characters will be appended
public static java.lang.String leftJustify(java.lang.String s, int len)
public static java.lang.String padLeft(java.lang.String s, char padChar, int len)
s
- The input StringpadChar
- The pad characterlen
- The length up to which pad characters will be pre-pended
public static java.lang.String rightAlign(java.lang.String s, int len)
s
- The input Stringlen
- The length up to which ' ' characters will be pre-pended
public static java.lang.String rightJustify(java.lang.String s, int len)
public static java.lang.String rightAlign(long s, int len)
s
- The input Long valuelen
- The length up to which ' ' characters will be pre-pended
public static java.lang.String rightJustify(long s, int len)
public static java.lang.StringBuffer padToIndex(java.lang.StringBuffer sb, char padChar, int ndx)
sb
- The input StringBuffer (null is allowed)padChar
- The pad characterndx
- The column index
public static java.lang.String encodeNewline(java.lang.String text)
text
- The input String
public static java.lang.StringBuffer encodeNewline(java.lang.StringBuffer sb)
sb
- The input StringBuffer
public static java.lang.String decodeNewline(java.lang.String text)
text
- The input String
public static java.lang.StringBuffer decodeNewline(java.lang.StringBuffer sb)
sb
- The input StringBuffer
public static java.lang.String escapeChars(java.lang.String text)
text
- The input String
public static java.lang.String encodeEscapedCharacters(java.lang.String text)
text
- The input String
public static java.lang.StringBuffer encodeEscapedCharacters(java.lang.StringBuffer sb)
sb
- The input StringBuffer
public static java.lang.String unescapeChars(java.lang.String text)
text
- The input String
public static java.lang.String decodeEscapedCharacters(java.lang.String text)
text
- The input String
public static java.lang.StringBuffer decodeEscapedCharacters(java.lang.StringBuffer sb)
sb
- The input StringBuffer
public static java.lang.String replace(java.lang.String text, java.lang.String key, java.lang.String val)
text
- The input Stringkey
- The key pattern Stringval
- The replacement value String
public static java.lang.StringBuffer replace(java.lang.StringBuffer sb, java.lang.String key, java.lang.String val)
sb
- The input StringBufferkey
- The key pattern Stringval
- The replacement value String
public static java.lang.String regexReplace(java.lang.String target, java.lang.String regex, java.lang.String val)
target
- The input Stringregex
- The regular expression pattern Stringval
- The replacement value String
public static java.lang.StringBuffer regexReplace(java.lang.StringBuffer target, java.lang.String regexKey, java.lang.String val)
target
- The input StringBufferregexKey
- The regular expression pattern Stringval
- The replacement value String
public static boolean regexMatches(java.lang.String target, java.lang.String regex)
target
- The tested Stringregex
- The regular expression
public static StringTools.RegexIndex regexIndexOf(java.lang.String target, java.lang.String regex)
target
- The target Stringregex
- The regular expression
public static StringTools.RegexIndex regexIndexOf(java.lang.String target, java.lang.String regex, int ndx)
target
- The target Stringregex
- The regular expressionndx
- The position within the target String to start searching for the regular expression
public static StringTools.RegexIndex regexIndexOf(StringTools.RegexIndex regNdx)
regNdx
- A previously obtained RegexIndex object
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, java.lang.String[][] rep)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablerep
- An array containing key/value pairs
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, java.lang.String[][] rep, boolean htmlFilter)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablerep
- An array containing key/value pairshtmlFilter
- True to encode the resulting key value for display within an html context
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, java.util.Map<java.lang.String,java.lang.String> map)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablemap
- A map containing key/value pairs
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, java.util.Map<java.lang.String,java.lang.String> map, boolean htmlFilter)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablemap
- A map containing key/value pairshtmlFilter
- True to encode the resulting key value for display within an html context
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, StringTools.KeyValueMap rmap)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablermap
- A StringTools.KeyValueMap (previously ReplacementMap) containing key/value pairs
public static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, StringTools.KeyValueMap rmap, boolean htmlFilter)
text
- The target StringstartDelim
- The pattern used to determine the start of a 'key' variableendDelim
- The pattern used to determine the end of a key variablermap
- A StringTools.KeyValueMap (previously ReplacementMap) containing key/value pairshtmlFilter
- True to encode the resulting key value for display within an html context
public static java.lang.String formatLine(java.lang.String fmt, java.lang.Object... v)
fmt
- The String formatv
- The array of replacement items
public static int compareVersions(java.lang.String V1, java.lang.String V2)
V1
- The first version string of the form "a.b.c-B##"V2
- The second version string of the form "a.b.c-B##"
public static int compare(byte[] b1, byte[] b2)
b1
- First byte arrayb2
- Second byte array
public static int compare(byte[] b1, byte[] b2, int len)
b1
- First byte arrayb2
- Second byte arraylen
- Length of bytes to compare
public static int compare(byte[] b1, java.lang.String s)
b1
- First byte arrays
- Second String value
public static boolean compareEquals(byte[] b1, byte[] b2, int len)
b1
- First byte arrayb2
- Second byte arraylen
- Length of bytes to compare
public static boolean compareEquals(byte[] b1, byte[] b2)
b1
- First byte arrayb2
- Second byte array
public static boolean compareEquals(byte[] b, java.lang.String s)
b
- First byte arrays
- Second String value
public static int diff(java.lang.String s1, java.lang.String s2)
s1
- First Strings2
- Second String
public static int diff(byte[] b1, byte[] b2)
b1
- First byte arrayb2
- Second byte array
public static int diff(byte[] b1, byte[] b2, int len)
b1
- First byte arrayb2
- Second byte arraylen
- Length of bytes to compare
public static java.lang.String format(double val, java.lang.String fmt)
val
- The double value to formatfmt
- The format pattern
public static java.lang.String format(double val, java.lang.String fmt, int fieldSize)
val
- The double value to formatfmt
- The format patternfieldSize
- The minimum formatted field width.
public static java.lang.String format(java.math.BigInteger val, java.lang.String fmt)
val
- The BigInteger value to formatfmt
- The format pattern
public static java.lang.String format(java.math.BigInteger val, java.lang.String fmt, int fieldSize)
val
- The BigInteger value to formatfmt
- The format patternfieldSize
- The minimum formatted field width.
public static java.lang.String format(long val, java.lang.String fmt)
val
- The long value to formatfmt
- The format pattern
public static java.lang.String format(long val, java.lang.String fmt, int fieldSize)
val
- The long value to formatfmt
- The format patternfieldSize
- The minimum formatted field width.
public static java.lang.String format(int val, java.lang.String fmt)
val
- The int value to formatfmt
- The format pattern
public static java.lang.String format(int val, java.lang.String fmt, int fieldSize)
val
- The int value to formatfmt
- The format patternfieldSize
- The minimum formatted field width.
public static java.lang.String format(short val, java.lang.String fmt)
val
- The short value to formatfmt
- The format pattern
public static java.lang.String format(short val, java.lang.String fmt, int fieldSize)
val
- The short value to formatfmt
- The format patternfieldSize
- The minimum formatted field width.
public static java.lang.String formatElapsedSeconds(long elapsedSec, int fmt)
elapsedSec
- The elapsed seconds to formatfmt
- Once of the following constant values:public static java.lang.String className(java.lang.Object c)
c
- The object for which the class name is returned
public static java.lang.Class classForName(java.lang.String n)
n
- The name of the class to return
public static boolean isAssignableFrom(java.lang.String targetClassName, java.lang.Class testClass)
public static boolean isAssignableFrom(java.lang.Class<?> targetClass, java.lang.Class<?> testClass)
public static java.lang.String compressDigits(long num)
num
- The long value to obfuscate
public static java.lang.String compressDigits(long num, java.lang.String alpha)
num
- The long value to obfuscatealpha
- The alphabet used to compress/obfuscate the long value
public static long decompressDigits(java.lang.String str)
str
- The String from which the long value will be decompressed/unobfuscated
public static long decompressDigits(java.lang.String str, java.lang.String alpha)
str
- The String from which the long value will be decompressed/unobfuscatedalpha
- The alphabet used to decompress/unobfuscate the long value (this must be
same alphabet used to compress/obfuscate the long value)
public static java.lang.String htmlFilterValue(java.lang.Object text)
text
- The Object to encode [via 'toString()' method]
public static java.lang.String htmlFilterText(java.lang.Object text)
text
- The Object to encode [via 'toString()' method]
public static java.lang.String htmlFilter(java.lang.Object text, StringTools.HTMLFilterType filterType)
text
- The Object to encode [via 'toString()' method]filterType
- Filter type (TEXT, VALUE)
public static java.lang.String createRandomString(int len)
len
- The resulting length of the returned String
public static java.lang.String createRandomString(int len, java.lang.String alpha)
len
- The resulting length of the returned Stringalpha
- The random characters will be pulled from this alphabet
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |