|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.util.StringUtil
A set of public static methods for dealing with Strings
Field Summary | |
private static char[] |
hex_table
|
Constructor Summary | |
StringUtil()
|
Method Summary | |
static java.lang.String |
formatForPrint(java.lang.String input)
Used to print out a string for error messages, chops is off at 60 chars for historical reasons. |
static byte[] |
fromHexString(java.lang.String s,
int offset,
int length)
Convert a hexidecimal string generated by toHexString() back into a byte array. |
static byte[] |
getAsciiBytes(java.lang.String input)
Get 7-bit ASCII character array from input String. |
static java.lang.String |
hexDump(byte[] data)
Convert a byte array to a human-readable String for debugging purposes. |
static boolean |
SQLEqualsIgnoreCase(java.lang.String s1,
java.lang.String s2)
Compares two strings Strings will be uppercased in english and compared equivalent to s1.equalsIgnoreCase(s2) throws NPE if s1 is null |
static java.lang.String |
SQLToLowerCase(java.lang.String s)
Convert string to lowercase Return java.util.Locale.ENGLISH lowercasing |
static java.lang.String |
SQLToUpperCase(java.lang.String s)
Convert string to uppercase Always use the java.util.ENGLISH locale |
static java.lang.String |
toHexString(byte[] data,
int offset,
int length)
Convert a byte array to a String with a hexidecimal format. |
static java.lang.String[] |
toStringArray(java.lang.Object[] objArray)
A method that receive an array of Objects and return a String array representation of that array. |
static java.lang.String |
trimTrailing(java.lang.String str)
Trim off trailing blanks but not leading blanks |
static java.lang.String |
truncate(java.lang.String value,
int length)
Truncate a String to the given length with no warnings or error raised if it is bigger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static char[] hex_table
Constructor Detail |
public StringUtil()
Method Detail |
public static final java.lang.String formatForPrint(java.lang.String input)
public static java.lang.String[] toStringArray(java.lang.Object[] objArray)
public static byte[] getAsciiBytes(java.lang.String input)
public static java.lang.String trimTrailing(java.lang.String str)
str
-
public static java.lang.String truncate(java.lang.String value, int length)
value
- String to be truncatedlength
- Maximum length of string
public static java.lang.String toHexString(byte[] data, int offset, int length)
b & 0xf0
), the second character
represents the low nibble (b & 0x0f
).
data[offset]
is represented by the first two characters in the returned String.
data
- byte arrayoffset
- starting byte (zero based) to convert.length
- number of bytes to convert.
public static byte[] fromHexString(java.lang.String s, int offset, int length)
s
- String to convertoffset
- starting character (zero based) to convert.length
- number of characters to convert.
public static java.lang.String hexDump(byte[] data)
public static java.lang.String SQLToUpperCase(java.lang.String s)
s
- string to uppercase
public static java.lang.String SQLToLowerCase(java.lang.String s)
s
- string to lowercase
public static boolean SQLEqualsIgnoreCase(java.lang.String s1, java.lang.String s2)
s1
- first string to compares2
- second string to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |