org.opengts.util
Class StringTools

java.lang.Object
  extended by org.opengts.util.StringTools

public class StringTools
extends java.lang.Object

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
<T> java.lang.Number
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

BACKSPACE

public static final char BACKSPACE
See Also:
Constant Field Values

FORM_FEED

public static final char FORM_FEED
See Also:
Constant Field Values

NEW_LINE

public static final char NEW_LINE
See Also:
Constant Field Values

CARRIAGE_RETURN

public static final char CARRIAGE_RETURN
See Also:
Constant Field Values

TAB

public static final char TAB
See Also:
Constant Field Values

WhitespaceChars

public static final java.lang.String WhitespaceChars
See Also:
Constant Field Values

KeyValSeparatorEQUAL

public static final char KeyValSeparatorEQUAL
See Also:
Constant Field Values

KeyValSeparatorCOLON

public static final char KeyValSeparatorCOLON
See Also:
Constant Field Values

KeyValSeparatorChar

public static final char KeyValSeparatorChar
See Also:
Constant Field Values

KeyValSeparatorChars

public static final char[] KeyValSeparatorChars

PropertySeparatorSPACE

public static final char PropertySeparatorSPACE
See Also:
Constant Field Values

PropertySeparatorSEMIC

public static final char PropertySeparatorSEMIC
See Also:
Constant Field Values

PropertySeparatorChar

public static final char PropertySeparatorChar
See Also:
Constant Field Values

STRING_TRUE

public static final java.lang.String STRING_TRUE
See Also:
Constant Field Values

STRING_FALSE

public static final java.lang.String STRING_FALSE
See Also:
Constant Field Values

FORMAT_DATE

public static final java.lang.String FORMAT_DATE
See Also:
Constant Field Values

FORMAT_DATE2

public static final java.lang.String FORMAT_DATE2
See Also:
Constant Field Values

FORMAT_TIME

public static final java.lang.String FORMAT_TIME
See Also:
Constant Field Values

CharEncoding_UTF_8

public static final java.lang.String CharEncoding_UTF_8
See Also:
Constant Field Values

CharEncoding_UTF_16

public static final java.lang.String CharEncoding_UTF_16
See Also:
Constant Field Values

CharEncoding_8859_1

public static final java.lang.String CharEncoding_8859_1
See Also:
Constant Field Values

CharEncoding_US_ASCII

public static final java.lang.String CharEncoding_US_ASCII
See Also:
Constant Field Values

HEX

public static final java.lang.String HEX
See Also:
Constant Field Values

ArraySeparator

public static final java.lang.String ArraySeparator
See Also:
Constant Field Values

ARRAY_DELIM

public static final char ARRAY_DELIM
See Also:
Constant Field Values

ARRAY_DOUBLE_QUOTE

public static final char ARRAY_DOUBLE_QUOTE
See Also:
Constant Field Values

ARRAY_SINGLE_QUOTE

public static final char ARRAY_SINGLE_QUOTE
See Also:
Constant Field Values

ARRAY_QUOTE

public static final char ARRAY_QUOTE
See Also:
Constant Field Values

STRIP_INCLUDE

public static final int STRIP_INCLUDE
See Also:
Constant Field Values

STRIP_EXCLUDE

public static final int STRIP_EXCLUDE
See Also:
Constant Field Values

KEY_START_ESC

public static final char KEY_START_ESC
See Also:
Constant Field Values

KEY_START

public static final java.lang.String KEY_START
See Also:
Constant Field Values

KEY_END

public static final java.lang.String KEY_END
See Also:
Constant Field Values

DFT_DELIM

public static final java.lang.String DFT_DELIM
See Also:
Constant Field Values

ARG_DELIM

public static final java.lang.String ARG_DELIM
See Also:
Constant Field Values

ELAPSED_FORMAT_SS

public static final int ELAPSED_FORMAT_SS
See Also:
Constant Field Values

ELAPSED_FORMAT_HHMMSS

public static final int ELAPSED_FORMAT_HHMMSS
See Also:
Constant Field Values

ELAPSED_FORMAT_HHMM

public static final int ELAPSED_FORMAT_HHMM
See Also:
Constant Field Values

ELAPSED_FORMAT_HHHhh

public static final int ELAPSED_FORMAT_HHHhh
See Also:
Constant Field Values

ELAPSED_FORMAT_HHHh

public static final int ELAPSED_FORMAT_HHHh
See Also:
Constant Field Values

ELAPSED_FORMAT_MMMSS

public static final int ELAPSED_FORMAT_MMMSS
See Also:
Constant Field Values

HTML_SP

public static final java.lang.String HTML_SP
See Also:
Constant Field Values

HTML_LT

public static final java.lang.String HTML_LT
See Also:
Constant Field Values

HTML_GT

public static final java.lang.String HTML_GT
See Also:
Constant Field Values

HTML_AMP

public static final java.lang.String HTML_AMP
See Also:
Constant Field Values

HTML_DEG

public static final java.lang.String HTML_DEG
See Also:
Constant Field Values

HTML_QUOTE

public static final java.lang.String HTML_QUOTE
See Also:
Constant Field Values

HTML_DOUBLE_QUOTE

public static final java.lang.String HTML_DOUBLE_QUOTE
See Also:
Constant Field Values

HTML_APOS

public static final java.lang.String HTML_APOS
See Also:
Constant Field Values

HTML_SINGLE_QUOTE

public static final java.lang.String HTML_SINGLE_QUOTE
See Also:
Constant Field Values

HTML_br

public static final java.lang.String HTML_br
See Also:
Constant Field Values

HTML_BR

public static final java.lang.String HTML_BR
See Also:
Constant Field Values

HTML_HR

public static final java.lang.String HTML_HR
See Also:
Constant Field Values
Constructor Detail

StringTools

public StringTools()
Method Detail

getCharacterEncoding

public static java.lang.String getCharacterEncoding()
Gets the character encoding used to encode/decode Strings

Returns:
The character encoding

getCharacterEncodings

public static java.lang.String[] getCharacterEncodings()
Returns an array of available character encodings

Returns:
The default character set

length

public static int length(java.lang.String s)
Return the length of the specified String

Parameters:
s - The String (may be null)
Returns:
The length of the String (or '0' if the String is null)

truncate

public static java.lang.String truncate(java.lang.String s,
                                        int maxLen)
Truncates the specified string to the specified length. Returns the String as-is if the length of the String is already less than the specified length

Parameters:
s - The String
maxLen - The maximum length
Returns:
The truncated string

getChars

public static char[] getChars(java.lang.String s)
Return a 'char' array of the specified String

Parameters:
s - The String from which the char array will be returned
Returns:
The array of 'char's from the specified String

getChars

public static char[] getChars(byte[] b)
Converts the specified byte array to an array of chars. This method converts a single byte to a single character. Multibyte character conversions are not supported.

Parameters:
b - The array of bytes to convert to characters
Returns:
The array of characters created from the byte array

getBytes

public 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())

Parameters:
sb - The StringBuffer which will be converted to a byte array
Returns:
The byte array representation of the StringBuffer

getBytes

public static byte[] getBytes(java.lang.String s)
Converts the specified String into a byte array based on the default character set (see StringTools.getCharacterEncoding())

Parameters:
s - The String which will be converted to a byte array
Returns:
The byte array representation of the specified String

getBytes

public static byte[] getBytes(char[] c)
Converts the specified char array into a byte array. Character are converted as 1 byte per character. Multibyte conversions are not supported by this method.

Parameters:
c - The char array which will be converted to a byte array
Returns:
The byte array representation of the specified char array

getBytesHex

public static byte[] getBytesHex(java.lang.String s)
Used for debug purposes only. If the specified String begins with "0x", the String is parsed as a Hex. Otherwise the String character bytes are returned.

Parameters:
s - The String which will be converted to a byte array
Returns:
The byte array representation of the specified String

isValidID

public static boolean isValidID(java.lang.String s,
                                char... x)
Returns true if the specified String is a valid ID. To be a valid ID, all of the following must be true:
- ID must be a non-empty String
- ID must start with a letter or digit
- ID must contain only alphanumeric or other specified characters

Parameters:
s - The String tested for alpha-numeric characters
x - Other valid characters allowed in the target string
Returns:
True if the specified String contains only alpha-numeric characters

isNumeric

public static boolean isNumeric(java.lang.Object n)
Returns true if the specified String contains only decimal numeric characters

Parameters:
n - The String tested for decimal numeric characters
Returns:
True if the specified String contains only decimal numeric characters

isNumeric

public static boolean isNumeric(java.lang.Object n,
                                boolean inclHex)
Returns true if the specified Object contains only decimal numeric characters

Parameters:
n - The String tested for decimal numeric characters
inclHex - True to include the A..F hex characters
Returns:
True if the specified String contains only decimal numeric characters

isNumeric

public static boolean isNumeric(java.lang.String s)
Returns true if the specified String contains only decimal numeric characters

Parameters:
s - The String tested for decimal numeric characters
Returns:
True if the specified String contains only decimal numeric characters

isNumeric

public static boolean isNumeric(java.lang.String s,
                                boolean inclHex)
Returns true if the specified String contains only numeric characters

Parameters:
s - The String tested for numeric characters
inclHex - True to include the A..F hex characters
Returns:
True if the specified String contains only numeric characters

isAlphaNumeric

public static boolean isAlphaNumeric(java.lang.String s,
                                     boolean inclSpace)
Returns true if the specified String contains only alpha-numeric characters

Parameters:
s - The String tested for alpha-numeric characters
inclSpace - True to include the space (" ") character as well
Returns:
True if the specified String contains only alpha-numeric characters

isAlphaNumeric

public static boolean isAlphaNumeric(java.lang.String s,
                                     char... x)
Returns true if the specified String contains only alpha-numeric characters

Parameters:
s - The String tested for alpha-numeric characters
x - Other valid characters allowed in the target string
Returns:
True if the specified String contains only alpha-numeric characters

isAlphaNumeric

public static boolean isAlphaNumeric(byte[] b)
Returns true if the specified byte array contains only AlphaNumeric characters

Parameters:
b - The byte array tested for AlphaNumeric
Returns:
True if the specified byte array contains only AlphaNumeric characters

isAlphaNumeric

public static boolean isAlphaNumeric(byte[] b,
                                     int ofs)
Returns true if the specified byte array contains only AlphaNumeric characters

Parameters:
b - The byte array tested for AlphaNumeric
Returns:
True if the specified byte array contains only AlphaNumeric characters

isAlphaNumeric

public static boolean isAlphaNumeric(byte[] b,
                                     int ofs,
                                     int len)
Returns true if the specified byte array contains only AlphaNumeric characters

Parameters:
b - The byte array tested for AlphaNumeric
ofs - The offset within the array to begin testing
len - The number of elements to test within the array
Returns:
True if the specified byte array contains only AlphaNumeric characters

isPrintableASCII

public static boolean isPrintableASCII(byte[] b)
Returns true if the specified byte array contains only printable ASCII characters

Parameters:
b - The byte array tested for printable ASCII
Returns:
True if the specified byte array contains only printable ASCII characters

isPrintableASCII

public static boolean isPrintableASCII(byte[] b,
                                       boolean inclSpace)
Returns true if the specified byte array contains only printable ASCII characters

Parameters:
b - The byte array tested for printable ASCII
inclSpace - True to include space characters (' ', '\t', '\n', '\r'), false to omit.
Returns:
True if the specified byte array contains only printable ASCII characters

isPrintableASCII

public static boolean isPrintableASCII(byte[] b,
                                       int ofs,
                                       int len,
                                       boolean inclSpace)
Returns true if the specified byte array contains only printable ASCII characters

Parameters:
b - The byte array tested for printable ASCII
ofs - The offset within the array to begin testing
len - The number of elements to test within the array
inclSpace - True to include space characters (' ', '\t', '\n', '\r'), false to omit.
Returns:
True if the specified byte array contains only printable ASCII characters

toStringValue

public 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. (does not return null)

Parameters:
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.
Returns:
The String representation of the specified String with unprintable characters replaced.

toStringValue

public 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.

Parameters:
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.
Returns:
The String representation of the specified byte array

toStringValue

public static java.lang.String toStringValue(byte[] b)
Converts the specified byte array to a String based on the default character set.

Parameters:
b - The byte array to convert to a String, based on the default character set.
Returns:
The String representation of the specified byte array

toStringValue

public static java.lang.String toStringValue(byte[] b,
                                             int ofs)
Converts the specified byte array to a String based on the default character set.

Parameters:
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
Returns:
The String representation of the specified byte array

toStringValue

public 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.

Parameters:
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
len - The number of bytes starting at the specified offset to convert to a String
repUnp - The character used to replace any detected unprintable characters.
Returns:
The String representation of the specified byte array

toStringValue

public 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.

Parameters:
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
len - The number of bytes starting at the specified offset to convert to a String
Returns:
The String representation of the specified byte array

toStringValue

public static java.lang.String toStringValue(char[] c)
Converts the specified character array to a String.

Parameters:
c - The char array to convert to a String
Returns:
The String representation of the specified char array

toString

public static java.lang.String toString(java.lang.Object v)
Returns a String representation of the specified value.
(used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(java.lang.Object[] v)
Returns a String representation of the specified value.
(used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(double v)
Returns a String representation of the specified value.
(used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(double[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(float v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(float[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(long v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(long[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(int v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(int[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(short v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(byte v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(byte[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(char v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toString

public static java.lang.String toString(char[] v)
Returns a String representation of the specified value (used for debug logging)

Parameters:
v - The value
Returns:
The String representation

toUTF8Bytes

public static byte[] toUTF8Bytes(byte[] b)
Converts the specified byte array to a String based on the UTF-8 character set.

Parameters:
b - The byte array to convert to a String, based on the UTF-8 character set.
Returns:
The converted byte array

toUTF16String

public static java.lang.String toUTF16String(byte[] b)
Converts the specified byte array to a String based on the default character set.

Parameters:
b - The byte array to convert to a String, based on the default character set.
Returns:
The String representation of the specified byte array

escapeJSON

public static java.lang.String escapeJSON(java.lang.String s)
Converts the specified String to a JSON escaped value String.

Parameters:
s - The String to convert to a JSON encoded String
Returns:
The JSON encoded String

escapeUnicode

public 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.

Parameters:
s - The String to convert to a Unicode encoded String
Returns:
The Unicode encoded String

unescapeUnicode

public 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.

Parameters:
u - The Unicode escaped ASCII String to convert to unicode character String
Returns:
The Unicode encoded String

trim

public 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.

Parameters:
sb - The StringBuffer to trim, or null to return an empty String
Returns:
The trimmed String

trim

public static java.lang.String trim(java.lang.Object obj)
Trims the leading/trailing blanks from the String representation of the specified Object argument.

Parameters:
obj - The Object String to trim, or null to return an empty String
Returns:
The trimmed String

trim

public 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.

Parameters:
str - The String to trim, or null to return an empty String
Returns:
The trimmed String

isBlank

public static boolean isBlank(java.lang.String s)
Returns true if the specified argument is null, or contains 0 or more whitespace characters.

Parameters:
s - The String to test for blank.
Returns:
True if the specified argument is blank, or null.

isBlank

public static boolean isBlank(java.lang.StringBuffer s)
Returns true if the specified argument is null, or contains 0 or more whitespace characters.

Parameters:
s - The StringBuffer to test for blank.
Returns:
True if the specified argument is blank, or null.

isBlank

public 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.

Parameters:
s - The Object to test for blank.
Returns:
True if the specified argument is blank, or null.

blankDefault

public 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

Parameters:
target - The specified target String
dft - The default String
Returns:
The target String is not blank, otherwise the default String

blankDefault

public 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

Parameters:
target - The specified target String
dft - The default String
Returns:
The target String is not blank, otherwise the default String

equals

public 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

Returns:
True if the specifed strings are equals, or are both null.

equalsIgnoreCase

public 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

Returns:
True if the specifed strings are equals, or are both null.

trimLeading

public static java.lang.String trimLeading(java.lang.String s,
                                           char c)
Trims the specified leading character from the input string

Parameters:
s - The input String
c - The leading character to trim

trimLeading

public static java.lang.String trimLeading(java.lang.String s)
Trims the leading spaces from the input string

Parameters:
s - The input String

trimLeading

public static java.lang.String trimLeading(java.lang.Object s)
Trims the leading spaces from the string value of the input object

Parameters:
s - The input object

trimTrailing

public static java.lang.String trimTrailing(java.lang.String s,
                                            char c)
Trims the specified trailing character from the input string

Parameters:
s - The input String
c - The trailing character to trim

trimTrailing

public static java.lang.String trimTrailing(java.lang.String s)
Trims the trailing spaces from the input string

Parameters:
s - The input String

trimTrailing

public static java.lang.String trimTrailing(java.lang.Object s)
Trims the trailing spaces from the string value of the input object

Parameters:
s - The input object

reverse

public static java.lang.String reverse(java.lang.String s)
Reverses the order of the characters in the specified String

Parameters:
s - The input String from which the returned String will be reversed.
Returns:
The input String with the character order reversed.

quoteString

public static java.lang.String quoteString(java.lang.String s)
Return the specified String as a Quoted String, using "double-quotes"

Parameters:
s - The String to quote
Returns:
The quoted String

quoteString

public static java.lang.String quoteString(java.lang.String s,
                                           char q)
Return the specified String as a Quoted String, using the specified quote character

Parameters:
s - The String to quote
q - The quote character to use to quote the String
Returns:
The quoted String

quoteCSVString

public static java.lang.String quoteCSVString(java.lang.String s)
Quote the specified String based on CSV rules

Parameters:
s - The String to quote
Returns:
The quotes String

encodeCSV

public static java.lang.String encodeCSV(java.lang.String[] d,
                                         boolean checkTextQuote)
Encode the specified array of Strings based on CSV encoding rules

Parameters:
d - The array of Strings to encode into a CSV line
checkTextQuote - Set true to prefix values with a "'" tick (required by Excel?)
Returns:
The encoded CSV line

encodeCSV

public static java.lang.String encodeCSV(java.lang.String[] d)
Encode the specified array of Strings based on CSV encoding rules

Parameters:
d - The array of Strings to encode into a CSV line
Returns:
The encoded CSV line

parseQuote

public static java.lang.String parseQuote(java.lang.String s)
Parse the specified quoted String into a non-quoted String

Parameters:
s - The quoted String to parse
Returns:
The non-quoted String

parseQuote

public static int parseQuote(char[] ch,
                             int a,
                             java.lang.StringBuffer sb)
Parse the specified character array into a non-quoted String

Parameters:
ch - The quoted char array to parse
a - The starting index within the char array to begin parsing
sb - The destination where the parsed un-quoted String is placed
Returns:
The index of the next character following the parsed String

parseNumber

public static <T> java.lang.Number parseNumber(java.lang.Object data,
                                               java.lang.Class<?> numberClass,
                                               java.lang.Number dft)
Parse the specified object into a Number value

Parameters:
data - The object to parse
dft - The default Number value if unable to parse the specified object
Returns:
The parsed Number value

parseDouble

public 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

Parameters:
b - The byte array to parse
ofs - The offset within the byte array to begin parsing
isBigEndian - True if the IEEE 754 with the byte array in in BigEndian order
dft - The default double returned if unable to parse a double value
Returns:
The parsed IEEE 754 double value

parseDouble

public static double[] parseDouble(java.lang.Object[] data,
                                   double dft)
Parse the specified Object array into a double array

Parameters:
data - The Object array to parse
dft - The default values used if unable to parse a specific entry in the Object array
Returns:
The parsed double array

parseDouble

public static double parseDouble(java.lang.Object data,
                                 double dft)
Parse the specified object into a double value

Parameters:
data - The object to parse
dft - The default double value if unable to parse the specified object
Returns:
The parsed double value

parseDouble

public static double parseDouble(java.lang.String data,
                                 double dft)
Parse the specified String into a double value

Parameters:
data - The String to parse
dft - The default double value if unable to parse the specified object
Returns:
The parsed double value

parseDouble

public static double parseDouble(StringTools.FilterNumber num,
                                 double dft)
Parse the specified FilterNumber into a double value

Parameters:
num - The FilterNumber to parse
dft - The default double value if unable to parse the specified object
Returns:
The parsed double value

isDouble

public static boolean isDouble(java.lang.String data,
                               boolean strict)
Return true if the specified String contains a valid double value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid double value

isDouble

public static boolean isDouble(java.lang.Object data,
                               boolean strict)
Return true if the specified Object contains a valid double value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid double value

parseFloat

public 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

Parameters:
b - The byte array to parse
ofs - The offset within the byte array to begin parsing
isBigEndian - True if the IEEE 754 with the byte array in in BigEndian order
dft - The default float returned if unable to parse a float value
Returns:
The parsed IEEE 754 float value

parseFloat

public static float parseFloat(java.lang.Object data,
                               float dft)
Parse the specified object into a float value

Parameters:
data - The object to parse
dft - The default float value if unable to parse the specified object
Returns:
The parsed float value

parseFloat

public static float parseFloat(java.lang.String data,
                               float dft)
Parse the specified String into a float value

Parameters:
data - The String to parse
dft - The default float value if unable to parse the specified object
Returns:
The parsed float value

parseFloat

public static float parseFloat(StringTools.FilterNumber num,
                               float dft)
Parse the specified FilterNumber into a float value

Parameters:
num - The FilterNumber to parse
dft - The default float value if unable to parse the specified object
Returns:
The parsed float value

isFloat

public static boolean isFloat(java.lang.String data,
                              boolean strict)
Return true if the specified String contains a valid float value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid float value

isFloat

public static boolean isFloat(java.lang.Object data,
                              boolean strict)
Return true if the specified Object contains a valid float value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid float value

parseLong

public static long[] parseLong(java.lang.Object[] data,
                               long dft)
Parse the specified Object array into a long array

Parameters:
data - The Object array to parse
dft - The default values used if unable to parse a specific entry in the Object array
Returns:
The parsed long array

parseLong

public static long parseLong(java.lang.Object data,
                             long dft)
Parse the specified object into a long value

Parameters:
data - The object to parse
dft - The default long value if unable to parse the specified object
Returns:
The parsed long value

parseLong

public static long parseLong(java.lang.String data,
                             long dft)
Parse the specified String into a long value

Parameters:
data - The String to parse
dft - The default long value if unable to parse the specified object
Returns:
The parsed long value

parseLong

public static long parseLong(StringTools.FilterNumber num,
                             long dft)
Parse the specified FilterNumber into a long value

Parameters:
num - The FilterNumber to parse
dft - The default long value if unable to parse the specified object
Returns:
The parsed long value

parseLong

public static long parseLong(byte[] b,
                             int ofs,
                             int len,
                             boolean isBigEndian,
                             boolean signed,
                             long dft)
Parse the specified byte array a long value

Parameters:
b - The byte array to parse
ofs - The offset within the byte array to begin parsing
len - The number of bytes to decode into the long value
isBigEndian - True if the value with the byte array in in BigEndian order
signed - If the encoded bytes represent a signed value
dft - The default long returned if unable to parse a long value
Returns:
The parsed long value

isLong

public static boolean isLong(java.lang.String data,
                             boolean strict)
Return true if the specified String contains a valid long value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid long value

isLong

public static boolean isLong(java.lang.Object data,
                             boolean strict)
Return true if the specified Object contains a valid long value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid long value

parseInt

public static int[] parseInt(java.lang.Object[] data,
                             int dft)
Parse the specified Object array into a int array

Parameters:
data - The Object array to parse
dft - The default values used if unable to parse a specific entry in the Object array
Returns:
The parsed int array

parseInt

public static int parseInt(java.lang.Object data,
                           int dft)
Parse the specified object into a int value

Parameters:
data - The object to parse
dft - The default int value if unable to parse the specified object
Returns:
The parsed int value

parseInt

public static int parseInt(java.lang.String data,
                           int dft)
Parse the specified String into a int value

Parameters:
data - The String to parse
dft - The default int value if unable to parse the specified object
Returns:
The parsed int value

parseInt

public static int parseInt(StringTools.FilterNumber num,
                           int dft)
Parse the specified FilterNumber into a int value

Parameters:
num - The FilterNumber to parse
dft - The default int value if unable to parse the specified object
Returns:
The parsed int value

parseInt

public static int parseInt(byte[] b,
                           int ofs,
                           int len,
                           boolean isBigEndian,
                           boolean signed,
                           int dft)
Parse the specified byte array an int value

Parameters:
b - The byte array to parse
ofs - The offset within the byte array to begin parsing
len - The number of bytes to decode into the int value
isBigEndian - True if the value with the byte array in in BigEndian order
signed - If the encoded bytes represent a signed value
dft - The default int returned if unable to parse an int value
Returns:
The parsed long value

isInt

public static boolean isInt(java.lang.String data,
                            boolean strict)
Return true if the specified String contains a valid int value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid int value

isInt

public static boolean isInt(java.lang.Object data,
                            boolean strict)
Return true if the specified Object contains a valid int value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid int value

parseShort

public static short parseShort(java.lang.Object data,
                               short dft)
Parse the specified object into a short value

Parameters:
data - The object to parse
dft - The default short value if unable to parse the specified object
Returns:
The parsed short value

parseShort

public static short parseShort(java.lang.String data,
                               short dft)
Parse the specified String into a short value

Parameters:
data - The String to parse
dft - The default short value if unable to parse the specified object
Returns:
The parsed short value

parseShort

public static short parseShort(StringTools.FilterNumber num,
                               short dft)
Parse the specified FilterNumber into a short value

Parameters:
num - The FilterNumber to parse
dft - The default short value if unable to parse the specified object
Returns:
The parsed short value

isShort

public static boolean isShort(java.lang.String data,
                              boolean strict)
Return true if the specified String contains a valid short value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid short value

isShort

public static boolean isShort(java.lang.Object data,
                              boolean strict)
Return true if the specified Object contains a valid short value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid short value

parseBigInteger

public static java.math.BigInteger parseBigInteger(java.lang.Object data,
                                                   java.math.BigInteger dft)
Parse the specified object into a BigInteger value

Parameters:
data - The object to parse
dft - The default BigInteger value if unable to parse the specified object
Returns:
The parsed BigInteger value

parseBigInteger

public static java.math.BigInteger parseBigInteger(java.lang.String data,
                                                   java.math.BigInteger dft)
Parse the specified String into a BigInteger value

Parameters:
data - The String to parse
dft - The default BigInteger value if unable to parse the specified object
Returns:
The parsed BigInteger value

parseBigInteger

public static java.math.BigInteger parseBigInteger(StringTools.FilterNumber num,
                                                   java.math.BigInteger dft)
Parse the specified FilterNumber into a BigInteger value

Parameters:
num - The FilterNumber to parse
dft - The default BigInteger value if unable to parse the specified object
Returns:
The parsed BigInteger value

isBigInteger

public static boolean isBigInteger(java.lang.String data,
                                   boolean strict)
Return true if the specified String contains a valid BigInteger value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid BigInteger value

isBigInteger

public static boolean isBigInteger(java.lang.Object data,
                                   boolean strict)
Return true if the specified Object contains a valid BigInteger value

Parameters:
data - The Object to test
strict - 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.
Returns:
True if the specified String contains a valid BigInteger value

parseBoolean

public static boolean parseBoolean(java.lang.Object data,
                                   boolean dft)
Parse the specified Object into a boolean value

Parameters:
data - The object to parse
dft - The default boolean value if unable to parse the specified object
Returns:
The parsed boolean value

parseBoolean

public static boolean parseBoolean(java.lang.String data,
                                   boolean dft)
Parse the specified String into a boolean value

Parameters:
data - The String to parse
dft - The default boolean value if unable to parse the specified object
Returns:
The parsed boolean value

isBoolean

public static boolean isBoolean(java.lang.String data,
                                boolean strict)
Return true if the specified String contains a valid boolean value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid boolean value

isBoolean

public static boolean isBoolean(java.lang.Object data,
                                boolean strict)
Return true if the specified String contains a valid boolean value

Parameters:
data - The String to test
strict - 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.
Returns:
True if the specified String contains a valid boolean value

parseString

public static java.lang.String parseString(java.lang.Object data,
                                           java.lang.String dft)
Parse the specified Object into a String value

Parameters:
data - The object to parse
dft - The default String value if unable to parse the specified Object
Returns:
The parsed String value

parseString

public static java.lang.String parseString(byte[] data,
                                           java.lang.String dft)
Parse the specified byte array into a String value (ASCII characterset only). String will terminate with the first null ("0") byte encountered, or the end of the byte array, whichever is encountered first.

Parameters:
data - The byte array to parse
dft - The default String value if unable to parse the specified byte array
Returns:
The parsed String value

parseString

public 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). String will terminate with the first null ("0") byte encountered, or the end of the byte array, whichever is encountered first.

Parameters:
data - The byte array to parse
ofs - The offset into the byte array to begin parsing
dft - The default String value if unable to parse the specified byte array
Returns:
The parsed String value

parseDimension

public static java.awt.Dimension parseDimension(java.lang.String data,
                                                java.awt.Dimension dft)
Parse the specified String into a Dimension object

Parameters:
data - The String object to parse
dft - The default Dimension object if unable to parse the String
Returns:
The parsed Dimension object

isHexDigit

public static boolean isHexDigit(char ch)
Returns true if the specified character is a Hex digit

Parameters:
ch - The character containing the hex digit to test
Returns:
True if the specified character is a Hex digit

isHexDigit

public static boolean isHexDigit(byte b)
Returns true if the specified character is a Hex digit

Parameters:
b - The byte containing the ASCII hex digit to test
Returns:
True if the specified byte is an ASCII Hex digit

hexIndex

public static int hexIndex(char ch)
Returns the value of the specified hex character

Parameters:
ch - The hex character to return the value
Returns:
The value of the specified hex character, or -1 if the specified character is not a valid hex character

hexNybble

public static char hexNybble(byte nybble)
Returns the hex character for the least significant nybble of the specified byte

Parameters:
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.
Returns:
The character representation of the specifified nybble

hexNybble

public static char hexNybble(int nybble)
Returns the hex character for the least significant nybble of the specified byte

Parameters:
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.
Returns:
The character representation of the specifified nybble

parseHex

public static byte[] parseHex(java.lang.String data,
                              byte[] dft)
Parse the specified String, containing a hex representation, into a byte array

Parameters:
data - The String containing the hex character values
dft - The default byte array return if unable to convert the specified String value
Returns:
The parse byte array

parseHexAscii

public 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

Parameters:
data - The String hex representation to convert to a String
dft - The default String value to return if unable to convert the specified String hex representation.
Returns:
The parsed ASCII String value

parseHex

public static short parseHex(java.lang.String data,
                             short dft)
Parse the String containing a hex representation into an short (16-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default short value to return if unable to convert the specified String hex representation.
Returns:
The parse int value

parseHexShort

public static short parseHexShort(java.lang.String data,
                                  short dft)
Parse the String containing a hex representation into an short (16-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default short value to return if unable to convert the specified String hex representation.
Returns:
The parse int value

parseHex

public static int parseHex(java.lang.String data,
                           int dft)
Parse the String containing a hex representation into an int (32-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default int value to return if unable to convert the specified String hex representation.
Returns:
The parse int value

parseHexInt

public static int parseHexInt(java.lang.String data,
                              int dft)
Parse the String containing a hex representation into an int (32-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default int value to return if unable to convert the specified String hex representation.
Returns:
The parse int value

parseHex

public static long parseHex(java.lang.String data,
                            long dft)
Parse the String containing a hex representation into a long (64-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default long value to return if unable to convert the specified String hex representation.
Returns:
The parse long value

parseHexLong

public static long parseHexLong(java.lang.String data,
                                long dft)
Parse the String containing a hex representation into a long (64-bit) value

Parameters:
data - The String hex representation to convert to a String
dft - The default long value to return if unable to convert the specified String hex representation.
Returns:
The parse long value

hexLength

public static int hexLength(java.lang.String data)
Returns the number of valid hex characters found in the specified String

Parameters:
data - The String containing the hex representation
Returns:
The number of valid hex characters

isHex

public static boolean isHex(java.lang.String data,
                            boolean strict)
Returns true if the specified String contains hext characters

Parameters:
data - The String representation of the hex characters to test
strict - True to check for strict hex character values, false to allow for trailing superfluous characters.
Returns:
True if the specified String contains a valie hex representation, false otherwise.

formatHexString

public 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.

Parameters:
b - The byte array to convert to a String representation
Returns:
The hex representation in the form of a StringBuffer

formatHexString

public 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.

Parameters:
b - The byte array to convert to a String representation
blockLen - The number of bytes display on a single row.
Returns:
The hex representation in the form of a StringBuffer

formatHexString

public 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.

Parameters:
b - The byte array to convert to a String representation
blockLen - The number of bytes display on a single row
sb - The destination ouput StringBuffer
Returns:
The hex representation in the form of a StringBuffer

formatHexString

public 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.

Parameters:
b - The byte array to convert to a String representation
bOfs - The starting index where the byte array contents will be dipsplayed
bLen - The number of byte to display from the specified byte array
blockLen - The number of bytes display on a single row
showAscii - True to display the
sb - The destination ouput StringBuffer
Returns:
The hex representation in the form of a StringBuffer

toHexString

public static java.lang.StringBuffer toHexString(byte b,
                                                 java.lang.StringBuffer sb)
Converts the specified byte to a String hex representation

Parameters:
b - The byte to convert to a String hex representation
sb - The destination StringBuffer where the hex String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String hex representation is placed

toHexString

public static java.lang.String toHexString(byte b)
Converts the specified byte to a String hex representation

Parameters:
b - The byte to convert to a String hex representation
Returns:
The String containing the hex representation

toHexString

public 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

Parameters:
b - The byte array to convert to a String hex representation
ofs - The offset into the byte array to start the hex conversion
len - The number of bytes to convert to hex
sb - The destination StringBuffer where the hex String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String hex representation is placed

toHexString

public static java.lang.StringBuffer toHexString(byte[] b,
                                                 java.lang.StringBuffer sb)
Converts the specified byte array to a String hex representation

Parameters:
b - The byte array to convert to a String hex representation
sb - The destination StringBuffer where the hex String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String hex representation is placed

toHexString

public static java.lang.String toHexString(byte[] b)
Converts the specified byte array to a String hex representation

Parameters:
b - The byte array to convert to a String hex representation
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(byte[] b,
                                           int ofs,
                                           int len)
Converts the specified byte array to a String hex representation

Parameters:
b - The byte array to convert to a String hex representation
ofs - The offset into the byte array to start the hex conversion
len - The number of bytes to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(java.math.BigInteger val,
                                           int bitLen)
Converts the specified BigInteger value to a hex representation

Parameters:
val - The BigInteger value to convert to hex
bitLen - The length of significant bits to include in the hex representation
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(java.math.BigInteger val)
Converts the specified long value to a hex representation

Parameters:
val - The long value to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(int val,
                                           int bitLen)
Converts the specified long value to a hex representation

Parameters:
val - The long value to convert to hex
bitLen - The length of significant bits to include in the hex representation
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(long val,
                                           int bitLen)
Converts the specified long value to a hex representation

Parameters:
val - The long value to convert to hex
bitLen - The length of significant bits to include in the hex representation
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(long val)
Converts the specified long value to a hex representation

Parameters:
val - The long value to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(int val)
Converts the specified int value to a hex representation

Parameters:
val - The int value to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(short val)
Converts the specified short value to a hex representation

Parameters:
val - The short value to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(java.lang.Number val)
Converts the specified short value to a hex representation

Parameters:
val - The short value to convert to hex
Returns:
The String containing the hex representation

toHexString

public static java.lang.String toHexString(java.lang.Number val,
                                           int bitLen)
Converts the specified short value to a hex representation

Parameters:
val - The short value to convert to hex
Returns:
The String containing the hex representation

toBinaryString

public 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

Parameters:
b - The byte array to convert to a String binary representation
ofs - The offset into the byte array to start the binary conversion
len - The number of bytes to convert to binary
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.StringBuffer toBinaryString(byte[] b,
                                                    java.lang.StringBuffer sb)
Converts the specified byte array to a String binary representation

Parameters:
b - The byte array to convert to a String binary representation
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.String toBinaryString(byte[] b)
Converts the specified byte array to a String binary representation

Parameters:
b - The byte array to convert to a String binary representation
Returns:
The String containing the binary representation

toBinaryString

public static java.lang.String toBinaryString(byte[] b,
                                              int ofs,
                                              int len)
Converts the specified byte array to a String binary representation

Parameters:
b - The byte array to convert to a String binary representation
ofs - The offset into the byte array to start the binary conversion
len - The number of bytes to convert to binary
Returns:
The String containing the binary representation

toBinaryString

public static java.lang.StringBuffer toBinaryString(byte b,
                                                    java.lang.StringBuffer sb)
Converts the specified byte to a String binary representation

Parameters:
b - The byte to convert to a String binary representation
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.String toBinaryString(byte b)
Converts the specified byte to a String binary representation

Parameters:
b - The byte to convert to a String binary representation
Returns:
The String containing the binary representation

toBinaryString

public static java.lang.StringBuffer toBinaryString(int i,
                                                    java.lang.StringBuffer sb)
Converts the specified int to a String binary representation

Parameters:
i - The int to convert to a String binary representation
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.String toBinaryString(int i)
Converts the specified int to a String binary representation

Parameters:
i - The int to convert to a String binary representation
Returns:
The String containing the binary representation

toBinaryString

public static java.lang.StringBuffer toBinaryString(long i,
                                                    int bc,
                                                    java.lang.StringBuffer sb)
Converts the specified int to a String binary representation

Parameters:
i - The 'long' to convert to a String binary representation
bc - The bit-count to return
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.StringBuffer toBinaryString(long i,
                                                    java.lang.StringBuffer sb)
Converts the specified int to a String binary representation

Parameters:
i - The 'long' to convert to a String binary representation
sb - The destination StringBuffer where the binary String is placed. If null, a new StringBuffer will be created.
Returns:
The StringBuffer where the String binary representation is placed

toBinaryString

public static java.lang.String toBinaryString(long i)
Converts the specified int to a String binary representation

Parameters:
i - The 'long' to convert to a String binary representation
Returns:
The String containing the binary representation

setFirstUpperCase

public 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.

Parameters:
s - The String to convert to upper/lower case characters
Returns:
The converted String

startsWith

public static boolean startsWith(byte[] b,
                                 java.lang.String p)
Returns true if the specified byte array starts with the pattern String

Parameters:
b - The byte array
p - The pattern String
Returns:
True if the byte array starts with the pattern String, false otherwise.

startsWith

public static boolean startsWith(byte[] b,
                                 java.lang.String[] ap)
Returns true if the specified byte array starts with any of the specified pattern Strings

Parameters:
b - The byte array
ap - An array of pattern Strings
Returns:
True if the byte array starts with a pattern String, false otherwise.

startsWith

public static boolean startsWith(java.lang.String t,
                                 java.lang.String p)
Returns true if the specified target String starts with the pattern String

Parameters:
t - The target String
p - The pattern String
Returns:
True if the target String starts with the pattern String, false otherwise.

startsWith

public 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

Parameters:
t - The target String
ap - An array of pattern Strings
Returns:
True if the target String starts with a pattern String, false otherwise.

startsWithIgnoreCase

public 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)

Parameters:
t - The target String
p - The pattern String
Returns:
True if the target String starts with the pattern String, false otherwise.

startsWithIgnoreCase

public 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.

Parameters:
t - The target String
ap - An array of pattern Strings
Returns:
True if the target String starts with a pattern String, false otherwise.

endsWith

public static boolean endsWith(java.lang.String t,
                               java.lang.String p)
Returns true if the specified target String ends with the pattern String

Parameters:
t - The target String
p - The pattern String
Returns:
True if the target String ends with the pattern String, false otherwise.

endsWithIgnoreCase

public 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)

Parameters:
t - The target String
p - The pattern String
Returns:
True if the target String ends with the pattern String, false otherwise.

endsWithIgnoreCase

public 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.

Parameters:
t - The test String
p - An array of pattern Strings
Returns:
True if the test String ends with any pattern String, false otherwise.

indexOfIgnoreCase

public 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.

Parameters:
t - The test String
p - The pattern String
Returns:
The position of the pattern String within the test String, or -1 if the pattern String does not exist within the test String.

indexOfIgnoreCase

public static int indexOfIgnoreCase(java.lang.String tt,
                                    java.lang.String[] pp)
Returns index/position of the first matching pattern String within the target String

Parameters:
tt - The target String
pp - The array of pattern Strings
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

indexOf

public static int indexOf(java.lang.String t,
                          java.lang.String p)
Returns index/position of the pattern String within the target String

Parameters:
t - The target String (may be null)
p - The pattern String
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

indexOf

public static int indexOf(java.lang.String t,
                          char c)
Returns index/position of the pattern character within the target String

Parameters:
t - The target String (may be null)
c - The pattern character
Returns:
The position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

indexOf

public static int indexOf(java.lang.String t,
                          int n,
                          java.lang.String p)
Returns index/position of the pattern String within the target String

Parameters:
t - The target String (may be null)
n - The starting index
p - The pattern String (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

indexOf

public static int indexOf(java.lang.String t,
                          int n,
                          char c)
Returns index/position of the pattern character within the target String

Parameters:
t - The target String (may be null)
n - The starting index
c - The pattern character (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

indexOf

public static int indexOf(java.lang.String tt,
                          java.lang.String... pp)
Returns index/position of the first matching pattern String within the target String

Parameters:
tt - The target String (may be null)
pp - The array of pattern Strings
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

indexOf

public static int indexOf(java.lang.String tt,
                          char... cc)
Returns index/position of the first matching pattern character within the target String

Parameters:
tt - The target String (may be null)
cc - The array of pattern characters
Returns:
The position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

indexOf

public 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

Parameters:
tt - The target String (may be null)
n - The starting index
pp - The array of pattern Strings (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

indexOf

public static int indexOf(java.lang.String tt,
                          int n,
                          char... cc)
Returns index/position of the first matching pattern character within the target String

Parameters:
tt - The target String (may be null)
n - The starting index
cc - The array of pattern characters (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern character within the target String, or -1 if the pattern String does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String t,
                              java.lang.String p)
Returns last index/position of the pattern String within the target String

Parameters:
t - The target String (may be null)
p - The pattern String
Returns:
The last position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String t,
                              char c)
Returns last index/position of the pattern character within the target String

Parameters:
t - The target String (may be null)
c - The pattern character
Returns:
The last position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

lastIndexOf

public 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

Parameters:
t - The target String (may be null)
n - The starting index
p - The pattern String (moved to the end to allow for multiple pattern specifications)
Returns:
The last position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String t,
                              int n,
                              char c)
Returns last index/position of the pattern character within the target String

Parameters:
t - The target String (may be null)
n - The starting index
c - The pattern character (moved to the end to allow for multiple pattern specifications)
Returns:
The last position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String tt,
                              java.lang.String... pp)
Returns index/position of the last matching pattern String within the target String

Parameters:
tt - The target String (may be null)
pp - The array of pattern Strings
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String tt,
                              char... cc)
Returns index/position of the last matching pattern character within the target String

Parameters:
tt - The target String (may be null)
cc - The array of pattern characters
Returns:
The position of the pattern character within the target String, or -1 if the pattern character does not exist within the target String.

lastIndexOf

public 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

Parameters:
tt - The target String (may be null)
n - The starting index
pp - The array of pattern Strings (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern String within the target String, or -1 if the pattern String does not exist within the target String.

lastIndexOf

public static int lastIndexOf(java.lang.String tt,
                              int n,
                              char... cc)
Returns index/position of the last matching pattern character within the target String

Parameters:
tt - The target String (may be null)
n - The starting index
cc - The array of pattern characters (moved to the end to allow for multiple pattern specifications)
Returns:
The position of the pattern character within the target String, or -1 if the pattern String does not exist within the target String.

contains

public static boolean contains(java.lang.String t,
                               java.lang.String m)
Returns true if the pattern string is contained within the target string.

Parameters:
t - The target String
m - The pattern String
Returns:
True if the pattern string is contained within the target string

containsIgnoreCase

public 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.

Parameters:
t - The target String
m - The pattern String
Returns:
True if the pattern string is contained within the target string

indexOf

public static int indexOf(char[] A,
                          char c)
Returns the position of the specified pattern character within the character array

Parameters:
A - The character array
c - The pattern character
Returns:
The position of the pattern character within the test character array, or -1 if the pattern character does not exist within the test character array

indexOf

public static int indexOf(byte[] B,
                          byte b)
Returns the position of the specified pattern byte within the byte array

Parameters:
B - The byte array
b - The pattern byte
Returns:
The position of the pattern byte within the test byte array, or -1 if the pattern byte does not exist within the test byte array

parseArray

public static java.lang.String[] parseArray(java.lang.String s)
Parses the specified "," delimited String to an array of Strings. Quoted values are allowed within the delimited String and will be parsed as literal values in the String array.

Parameters:
s - The "," delimited String to parse
Returns:
An array of Strings which have been parsed from the input String

parseArray

public static java.lang.String[] parseArray(java.lang.String s,
                                            char arrayDelim)
Parses the specified character delimited String to an array of Strings. Quoted values are allowed within the delimited String and will be parsed as literal values in the String array.
NOTE: if the last entry is non-quoted and blank, it will be ignored.

Parameters:
s - The character delimited String to parse
arrayDelim - The character delimiter
Returns:
An array of Strings which have been parsed from the input String

encodeArray

public 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.

Parameters:
list - The array of Strings/Objects to encode
delim - The character delimter
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The array of Strings/Objects to encode
ofs - The offset within list to begin encoding into the returned String
max - The number of String fields to include from the specified list
delim - The character delimter
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The Object containing an array or list of Strings to encode
delim - The character delimter
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The Object containing an array or list of Strings to encode
ofs - The offset within list to begin encoding into the returned String
max - The number of String fields to include from the specified list
delim - The character delimter
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The List containing the Strings to encode
delim - The character delimter
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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. All returned String fields will be quoted.

Parameters:
list - The List containing the Strings to encode
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The List containing the Strings to encode
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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. All returned String fields will be quoted.

Parameters:
list - The array containing the Strings to encode
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The array containing the Strings to encode
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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. All returned String fields will be quoted.

Parameters:
list - The array containing the Strings to encode
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The array containing the Strings to encode
alwaysQuote - 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.\
Returns:
The encoded String

encodeArray

public 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. All returned String fields will be quoted.

Parameters:
list - The array containing the Strings to encode
Returns:
The encoded String

encodeArray

public 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.

Parameters:
list - The array containing the Strings to encode
alwaysQuote - 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.\
Returns:
The encoded String

toArray

public static java.lang.String[] toArray(java.util.List list)
Converts a list of Objects to an array of Strings

Parameters:
list - The list of objects to convert to an array of Strings
Returns:
The array of Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The String to parse
delim - The character delimiter
Returns:
The array of parse Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The String to parse
sdelim - The character delimiters (all characters in this String are considered individual delimiter candidates)
Returns:
The array of parse Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The StringBuffer to parse
delim - The character delimiter
Returns:
The array of parse Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The StringBuffer to parse
sdelim - The character delimiters (all characters in this String are considered individual delimiter candidates)
Returns:
The array of parse Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The StringBuffer to parse
sdelim - The character delimiters (all characters in this String are considered individual delimiter candidates)
trim - True to trim leading/trailing spaces
Returns:
The array of parse Strings

parseStringArray

public 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. If the input String is null, an empty (non-null) String array is returned.

Parameters:
value - The String to parse
sdelim - The character delimiters (all characters in this String are considered individual delimiter candidates)
trim - True to trim leading/trailing spaces
Returns:
The array of parse Strings

split

public static java.lang.String[] split(java.lang.String value,
                                       char delim)
See StringTools.parseStringArray(String, char)


split

public static java.lang.String[] split(java.lang.String value,
                                       char delim,
                                       boolean trim)
See StringTools.parseStringArray(String, char, boolean)


split

public static java.lang.String[] split(java.lang.StringBuffer value,
                                       char delim)
See StringTools.parseStringArray(StringBuffer, char)


split

public static java.lang.String[] split(java.lang.StringBuffer value,
                                       char delim,
                                       boolean trim)
See StringTools.parseStringArray(StringBuffer, char, boolean)


split

public 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". See StringTools.parseStringArray(StringBuffer, char, boolean)


split

public 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". See StringTools.parseStringArray(StringBuffer, char, boolean)


join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input String array
ofs - The offset into 'val' to begin concatenation
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input String array
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input String array
ofs - The offset into 'val' to begin concatenation
delim - The String delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input String array
delim - The String delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input Object array
ofs - The offset into 'val' to begin concatenation
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input Object array
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input Object array
ofs - The offset into 'val' to begin concatenation
delim - The String delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input String array are skipped.

Parameters:
val - The input Object array
delim - The String delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input list are skipped.

Parameters:
list - The input object list
ofs - The offset into 'list' to begin concatenation
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input list are skipped.

Parameters:
list - The input object list
delim - The character delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input list are skipped.

Parameters:
list - The input object list
ofs - The offset into 'list' to begin concatenation
delim - The String delimiter
Returns:
The concatinated String

join

public 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. Null elements in the input list are skipped.

Parameters:
list - The input object list
delim - The String delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input int array
delim - The character delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input int array
delim - The String delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input long array
delim - The character delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input long array
delim - The String delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input double array
delim - The character delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input double array
delim - The String delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input float array
delim - The character delimiter
Returns:
The concatinated String

join

public 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.

Parameters:
val - The input float array
delim - The String delimiter
Returns:
The concatinated String

parseProperties

public 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. Properties are specified as "key=value" pairs, and are separated from other property specifications by whitespace. Neither the property keys, or values may contain whitespace.

Parameters:
props - The String containing the list of properties
Returns:
The map containing the parsed property list

parseProperties

public 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. Properties are specified as "key=value" pairs, and are separated from other property specifications by the specified property separator character. Neither the property keys, or values may contain the specified property separator character.

Parameters:
props - The String containing the list of properties
propSep - The property separator charactor (ie. ' ', or ';')
Returns:
The map containing the parsed property list

parseProperties

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)
Parses a series of properties in the specified String into a property map. Properties are specified as "key=value" pairs, and are separated from other property specifications by whitespace. Neither the property keys, or values may contain whitespace.

Parameters:
props - The String containing the list of properties
properties - The map where the parsed properties will be placed. If null, a mew map object will be created.
Returns:
The map containing the parsed property list

parseProperties

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)
Parses a series of properties in the specified String into a property map. Properties are specified as "key=value" pairs, and are separated from other property specifications by the specified property separator character. Neither the property keys, or values may contain the specified property separator character.

Parameters:
props - The String containing the list of properties
propSep - 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.
Returns:
The map containing the parsed property list

parseProperties

public 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. Properties are specified as "key=value" pairs, and are separated from other property specifications by the specified property separator character. Neither the property keys, or values may contain the specified property separator character.

Parameters:
props - The String containing the list of properties
propSep - The property separator charactor (ie. ' ', or ';')
keyValSep - The key/value separator char (ie. '=' or ':')
Returns:
The map containing the parsed property list

parseProperties

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)
Parses a series of properties in the specified String into a property map. Properties are specified as "key=value" pairs, and are separated from other property specifications by the specified property separator character. Neither the property keys, or values may contain the specified property separator character.

Parameters:
props - The String containing the list of properties
propSep - 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.
Returns:
The map containing the parsed property list

stripChars

public static java.lang.String stripChars(java.lang.String src,
                                          char[] chars)
Strips the specified characters from the input String

Parameters:
src - The input String from which the characters will be removed
chars - The list of characters which will be removed from the input String
Returns:
The stripped String

stripChars

public static java.lang.String stripChars(java.lang.String src,
                                          char ch)
Strips the specified character from the input String

Parameters:
src - The input String from which the character will be removed
ch - The character which will be removed from the input String
Returns:
The stripped String

stripChars

public static java.lang.String stripChars(java.lang.String src,
                                          java.lang.String chars)
Strips the specified characters from the input String

Parameters:
src - The input String from which the characters will be removed
chars - The String of characters which will be removed from the input String
Returns:
The stripped String

stripChars

public static java.lang.String stripChars(java.lang.String src,
                                          char ch,
                                          int stripType)
Strips the specified character from the input String

Parameters:
src - The input String from which the character will be removed
ch - The character which will be removed from the input String
stripType - May be either STRIP_INCLUDE to include only the specified character, or STRIP_EXCLUDE to exclude the specified character.
Returns:
The stripped String

stripChars

public static java.lang.String stripChars(java.lang.String src,
                                          java.lang.String chars,
                                          int stripType)
Strips the specified characters from the input String

Parameters:
src - The input String from which the characters will be removed
chars - The list of characters which will be removed from the input String
stripType - May be either STRIP_INCLUDE to include only the specified characters, or STRIP_EXCLUDE to exclude the specified characters.
Returns:
The stripped String

trimTrailingComments

public static java.lang.String trimTrailingComments(java.lang.String S,
                                                    java.lang.String C)
Remove trailing comments from the rows in the specified string. Each line is assumed to be delimited with new-line characters. Note: Nothing is assumed about the leading characters in each row. It is important that the comment delimiter occur only once per line.

Parameters:
S - The input string
C - The comment delimiter.
Returns:
The result string with trailing comments removed. The rows are are again delimited using new-line characters.

replaceChars

public 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

Parameters:
src - The input String
ch - The character to replace
repChar - The replacement character
Returns:
The Stirng containing the replaced characters

replaceChars

public 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

Parameters:
src - The input String
chars - The characters to replace (any character found in this String will be replaced)
repChar - The replacement character
Returns:
The Stirng containing the replaced characters

replaceChars

public 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

Parameters:
src - The input String
chars - The characters to replace (any character found in this String will be replaced)
repStr - The replacement String
Returns:
The Stirng containing the replaced characters

replaceWhitespace

public static java.lang.String replaceWhitespace(java.lang.String src,
                                                 char repChar)
Replaces all whitespace found in the input String with the specified replacement character

Parameters:
src - The input String
repChar - The character used to replace whitespace characters
Returns:
The String containing the replaced characters (sans whitespace)

replaceWhitespace

public 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

Parameters:
src - The input String
repStr - The String used to replace whitespace characters
Returns:
The String containing the replaced characters (sans whitespace)

replaceKeys

public 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.

Parameters:
text - The text containing the "${key}" fields
keyMap - The KeyValueMap object used to retrieve values for the specific 'keys'

replaceKeys

public 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.

Parameters:
text - The text containing the "${key}" fields
keyMap - The KeyValueMap object used to retrieve values for the specific 'keys'

replaceKeys

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)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method.

Parameters:
text - The text containing the "${key}" fields
keyMap - The KeyValueMap object used to retrieve values for the specific 'keys'

replaceKeys

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)
Replaces all occurances of "${key}" with the value returned by the KeyValueMap interface 'getKeyValue' method.

Parameters:
repText - The text containing the "${key}" fields
keyMap - The KeyValueMap object used to retrieve values for the specific 'keys'

replicateString

public static java.lang.String replicateString(java.lang.String pattern,
                                               int count)
Returns a String containing the 'pattern' String replicated 'count' times.

Parameters:
pattern - The pattern String
count - The number of times to replicate the pattern Strin
Returns:
The repllicated pattern String

padRight

public 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. If the length of the String is equal-to, or greater-than, the specified length, the the input String is returned as-is.

Parameters:
s - The input String
padChar - The pad character
len - The length up to which pad characters will be appended
Returns:
The padded String

leftAlign

public static java.lang.String leftAlign(java.lang.String s,
                                         int len)
Pads the input String on the right with specified number of ' ' characters. If the length of the String is equal-to, or greater-than, the specified length, the the input String is returned as-is.

Parameters:
s - The input String
len - The length up to which ' ' characters will be appended
Returns:
The padded String

leftJustify

public static java.lang.String leftJustify(java.lang.String s,
                                           int len)
See StringTools.leftAlign(String,int)


padLeft

public 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. If the length of the String is equal-to, or greater-than, the specified length, the the input String is returned as-is.

Parameters:
s - The input String
padChar - The pad character
len - The length up to which pad characters will be pre-pended
Returns:
The padded String

rightAlign

public static java.lang.String rightAlign(java.lang.String s,
                                          int len)
Pads the input String on the left with specified number of ' ' characters. If the length of the String is equal-to, or greater-than, the specified length, the the input String is returned as-is.

Parameters:
s - The input String
len - The length up to which ' ' characters will be pre-pended
Returns:
The padded String

rightJustify

public static java.lang.String rightJustify(java.lang.String s,
                                            int len)
See StringTools.rightAlign(String,int)


rightAlign

public static java.lang.String rightAlign(long s,
                                          int len)
Pads the input Long on the left with specified number of ' ' characters. If the length of the Long is equal-to, or greater-than, the specified length, the the input String/Ling is returned as-is.

Parameters:
s - The input Long value
len - The length up to which ' ' characters will be pre-pended
Returns:
The padded String

rightJustify

public static java.lang.String rightJustify(long s,
                                            int len)
See StringTools.rightAlign(long,int)


padToIndex

public 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.

Parameters:
sb - The input StringBuffer (null is allowed)
padChar - The pad character
ndx - The column index
Returns:
The input StringBuffer (or a new StringBuffer if null was specified for the input StringBuffer)

encodeNewline

public static java.lang.String encodeNewline(java.lang.String text)
Remove all '\r', and replace all '\n' with "\\n".

Parameters:
text - The input String
Returns:
The NL encoded String

encodeNewline

public static java.lang.StringBuffer encodeNewline(java.lang.StringBuffer sb)
Remove all '\r', and replace all '\n' with "\\n".

Parameters:
sb - The input StringBuffer
Returns:
The NL encoded StringBuffer

decodeNewline

public static java.lang.String decodeNewline(java.lang.String text)
Replace all '\\n' with "\n".

Parameters:
text - The input String
Returns:
The NL decoded String

decodeNewline

public static java.lang.StringBuffer decodeNewline(java.lang.StringBuffer sb)
Replace all '\\n' with "\n".

Parameters:
sb - The input StringBuffer
Returns:
The NL decoded StringBuffer

escapeChars

public static java.lang.String escapeChars(java.lang.String text)
Replace all "\n" with "\\n".
Replace all "\r" with "\\r".
Replace all "\t" with "\\t".

Parameters:
text - The input String
Returns:
The encoded String

encodeEscapedCharacters

public static java.lang.String encodeEscapedCharacters(java.lang.String text)
Replace all "\n" with "\\n".
Replace all "\r" with "\\r".
Replace all "\t" with "\\t".

Parameters:
text - The input String
Returns:
The encoded String

encodeEscapedCharacters

public static java.lang.StringBuffer encodeEscapedCharacters(java.lang.StringBuffer sb)
Replace all "\n" with "\\n".
Replace all "\r" with "\\r".
Replace all "\t" with "\\t".

Parameters:
sb - The input StringBuffer
Returns:
The encoded StringBuffer

unescapeChars

public static java.lang.String unescapeChars(java.lang.String text)
Replace all "\\n" with "\n".
Replace all "\\r" with "\r".
Replace all "\\t" with "\t".

Parameters:
text - The input String
Returns:
The decoded String

decodeEscapedCharacters

public static java.lang.String decodeEscapedCharacters(java.lang.String text)
Replace all "\\n" with "\n".
Replace all "\\r" with "\r".
Replace all "\\t" with "\t".

Parameters:
text - The input String
Returns:
The decoded String

decodeEscapedCharacters

public static java.lang.StringBuffer decodeEscapedCharacters(java.lang.StringBuffer sb)
Replace all "\\n" with "\n".
Replace all "\\r" with "\r".
Replace all "\\t" with "\t".

Parameters:
sb - The input StringBuffer
Returns:
The decoded StringBuffer

replace

public 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.

Parameters:
text - The input String
key - The key pattern String
val - The replacement value String
Returns:
The String containing the replaced keys

replace

public 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.

Parameters:
sb - The input StringBuffer
key - The key pattern String
val - The replacement value String
Returns:
The StringBuffer containing the replaced keys

regexReplace

public 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.

Parameters:
target - The input String
regex - The regular expression pattern String
val - The replacement value String
Returns:
The String containing the replaced text

regexReplace

public 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.

Parameters:
target - The input StringBuffer
regexKey - The regular expression pattern String
val - The replacement value String
Returns:
The StringBuffer containing the replaced text

regexMatches

public static boolean regexMatches(java.lang.String target,
                                   java.lang.String regex)
Returns true if the target String matches the regular expression

Parameters:
target - The tested String
regex - The regular expression
Returns:
True if the target String matches the specified regular expression

regexIndexOf

public 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

Parameters:
target - The target String
regex - The regular expression
Returns:
The RegexIndex of the location of the regular expression within the target String

regexIndexOf

public 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

Parameters:
target - The target String
regex - The regular expression
ndx - The position within the target String to start searching for the regular expression
Returns:
The RegexIndex of the location of the regular expression within the target String

regexIndexOf

public static StringTools.RegexIndex regexIndexOf(StringTools.RegexIndex regNdx)
Finds the next occurance of the matching regular expression

Parameters:
regNdx - A previously obtained RegexIndex object
Returns:
The RegexIndex of the location of the regular expression within the target String

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
rep - An array containing key/value pairs
Returns:
The String containing the replaced key variables

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
rep - An array containing key/value pairs
htmlFilter - True to encode the resulting key value for display within an html context
Returns:
The String containing the replaced key variables

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
map - A map containing key/value pairs
Returns:
The String containing the replaced key variables

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
map - A map containing key/value pairs
htmlFilter - True to encode the resulting key value for display within an html context
Returns:
The String containing the replaced key variables

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
rmap - A StringTools.KeyValueMap (previously ReplacementMap) containing key/value pairs
Returns:
The String containing the replaced key variables

insertKeyValues

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)
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

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a 'key' variable
endDelim - The pattern used to determine the end of a key variable
rmap - A StringTools.KeyValueMap (previously ReplacementMap) containing key/value pairs
htmlFilter - True to encode the resulting key value for display within an html context
Returns:
The String containing the replaced key variables

formatLine

public 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. The format String may contain one or more of the following formatted items:
- {i[:f][=d]} Where i refers to the numeric index of the item in the replacement array, :f refers to the field size in which the item will be placed (f may be negative for right-aligned fields), and =d refers to the default value placed in the field if the array item is not defined.
- {C:#} Where C is the literal "C" to represent a "column" specification, # refers to the column index where the next item should be placed. # may also include a prefixing "+" to indicate a relative index position based on the previous column index.
Any other ascii characters values will be included in the formatted String as-is.

Parameters:
fmt - The String format
v - The array of replacement items
Returns:
The formatted String

compareVersions

public 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. (above) contain only numeric characters. If they contain any alpha characters, then this comparison method may not produce the desired results.

Parameters:
V1 - The first version string of the form "a.b.c-B##"
V2 - The second version string of the form "a.b.c-B##"
Returns:
-1 if (V1 < V2), 0 if (V1 == V2), 1 if (V1 > V2)

compare

public static int compare(byte[] b1,
                          byte[] b2)
Compares byte arrays for equality

Parameters:
b1 - First byte array
b2 - Second byte array
Returns:
0 if byte arrays are equal, < 0 if the first non-matching byte is less than the second, > 0 if the first non-matching byte is greater than the second

compare

public static int compare(byte[] b1,
                          byte[] b2,
                          int len)
Compares byte arrays for equality

Parameters:
b1 - First byte array
b2 - Second byte array
len - Length of bytes to compare
Returns:
0 if byte arrays are equal, < 0 if the first non-matching byte is less than the second, > 0 if the first non-matching byte is greater than the second

compare

public static int compare(byte[] b1,
                          java.lang.String s)
Compares byte arrays for equality

Parameters:
b1 - First byte array
s - Second String value
Returns:
0 if the byte array is equal to the specified String, < 0 if the first non-matching byte is less than the correspoinding character/byte in the String, > 0 if the first non-matching byte is greater than the correspoinding character/byte in the String

compareEquals

public static boolean compareEquals(byte[] b1,
                                    byte[] b2,
                                    int len)
Returns true if the specified byte arrays are equals

Parameters:
b1 - First byte array
b2 - Second byte array
len - Length of bytes to compare
Returns:
True if the byte arrays are equals, false otherwise

compareEquals

public static boolean compareEquals(byte[] b1,
                                    byte[] b2)
Returns true if the specified byte arrays are equals

Parameters:
b1 - First byte array
b2 - Second byte array
Returns:
True if the byte arrays are equals, false otherwise

compareEquals

public static boolean compareEquals(byte[] b,
                                    java.lang.String s)
Returns true if the specified byte array is equal to the specified String

Parameters:
b - First byte array
s - Second String value
Returns:
True if the byte array is equal to the String, false otherwise

diff

public static int diff(java.lang.String s1,
                       java.lang.String s2)
Compares 2 Strings, returning the index of the character where they differ

Parameters:
s1 - First String
s2 - Second String
Returns:
The index/location where the Strings differ, or -1 if they are the same

diff

public static int diff(byte[] b1,
                       byte[] b2)
Compares 2 byte arrays, returning the index of the byte where they differ

Parameters:
b1 - First byte array
b2 - Second byte array
Returns:
The index/location where the byte arrays differ, or -1 if they are the same

diff

public static int diff(byte[] b1,
                       byte[] b2,
                       int len)
Compares 2 byte arrays, returning the index of the byte where they differ

Parameters:
b1 - First byte array
b2 - Second byte array
len - Length of bytes to compare
Returns:
The index/location where the byte arrays differ, or -1 if they are the same

format

public 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

Parameters:
val - The double value to format
fmt - The format pattern
Returns:
The String containing the formatted double value

format

public 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.

Parameters:
val - The double value to format
fmt - The format pattern
fieldSize - The minimum formatted field width.
Returns:
The String containing the formatted double value

format

public 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

Parameters:
val - The BigInteger value to format
fmt - The format pattern
Returns:
The String containing the formatted long value

format

public 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:

Parameters:
val - The BigInteger value to format
fmt - The format pattern
fieldSize - The minimum formatted field width.
Returns:
The String containing the formatted BigInteger value

format

public 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

Parameters:
val - The long value to format
fmt - The format pattern
Returns:
The String containing the formatted long value

format

public 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:

Parameters:
val - The long value to format
fmt - The format pattern
fieldSize - The minimum formatted field width.
Returns:
The String containing the formatted long value

format

public 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

Parameters:
val - The int value to format
fmt - The format pattern
Returns:
The String containing the formatted int value

format

public 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

Parameters:
val - The int value to format
fmt - The format pattern
fieldSize - The minimum formatted field width.
Returns:
The String containing the formatted int value

format

public 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

Parameters:
val - The short value to format
fmt - The format pattern
Returns:
The String containing the formatted short value

format

public 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

Parameters:
val - The short value to format
fmt - The format pattern
fieldSize - The minimum formatted field width.
Returns:
The String containing the formatted short value

formatElapsedSeconds

public static java.lang.String formatElapsedSeconds(long elapsedSec,
                                                    int fmt)
Format elapsed second value

Parameters:
elapsedSec - The elapsed seconds to format
fmt - Once of the following constant values:
ELAPSED_FORMAT_SS : "SSSS"
ELAPSED_FORMAT_HHMMSS : "HH:MM:SS"
ELAPSED_FORMAT_HHMM : "HH:MM"
ELAPSED_FORMAT_HHHhh : "HHH.hh"
ELAPSED_FORMAT_HHHh : "HHH.h"
ELAPSED_FORMAT_MMMSS : "MMM:SS"
Returns:
The formatted elapsed second string

className

public static java.lang.String className(java.lang.Object c)
Returns the class name for the specified object. Does not return null.

Parameters:
c - The object for which the class name is returned
Returns:
The class name of the specified object. If the specified object is a Class object, then 'getName()' is used on the object to return the class name directly.

classForName

public 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.

Parameters:
n - The name of the class to return
Returns:
The Class instance for the speciied name.

isAssignableFrom

public static boolean isAssignableFrom(java.lang.String targetClassName,
                                       java.lang.Class testClass)
Returns true if the argument class can be assigned to the target class


isAssignableFrom

public static boolean isAssignableFrom(java.lang.Class<?> targetClass,
                                       java.lang.Class<?> testClass)
Returns true if the argument class can be assigned to the target class


compressDigits

public static java.lang.String compressDigits(long num)
Obfuscate the specified long value into a String

Parameters:
num - The long value to obfuscate
Returns:
The obfuscated long String

compressDigits

public 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).

Parameters:
num - The long value to obfuscate
alpha - The alphabet used to compress/obfuscate the long value
Returns:
The compressed/obfuscated long String

decompressDigits

public static long decompressDigits(java.lang.String str)
Decompress/Unobfuscate the specified String into a long value.

Parameters:
str - The String from which the long value will be decompressed/unobfuscated
Returns:
The decompressed/unobfuscated long value

decompressDigits

public 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)

Parameters:
str - The String from which the long value will be decompressed/unobfuscated
alpha - The alphabet used to decompress/unobfuscate the long value (this must be same alphabet used to compress/obfuscate the long value)
Returns:
The decompressed/unobfuscated long value

htmlFilterValue

public static java.lang.String htmlFilterValue(java.lang.Object text)
Encode special HTML character string for attibute specification "value='xxx'" (NOT for URL parameter use. See "URIArg.encodeArg" for encoding URL arg characters)

Parameters:
text - The Object to encode [via 'toString()' method]
Returns:
The encoded string.

htmlFilterText

public static java.lang.String htmlFilterText(java.lang.Object text)
Encode special HTML character string for node text

Parameters:
text - The Object to encode [via 'toString()' method]
Returns:
The encoded string.

htmlFilter

public static java.lang.String htmlFilter(java.lang.Object text,
                                          StringTools.HTMLFilterType filterType)
Encode special HTML character string

Parameters:
text - The Object to encode [via 'toString()' method]
filterType - Filter type (TEXT, VALUE)
Returns:
The encoded string.

createRandomString

public static java.lang.String createRandomString(int len)
Creates a random String value with the specified length

Parameters:
len - The resulting length of the returned String
Returns:
The String containing the random characters

createRandomString

public static java.lang.String createRandomString(int len,
                                                  java.lang.String alpha)
Creates a random String value with the specified length

Parameters:
len - The resulting length of the returned String
alpha - The random characters will be pulled from this alphabet
Returns:
The String containing the random characters

main

public static void main(java.lang.String[] argv)
Main entry point, used for debugging