public class UDUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
compare(java.lang.Comparable a,
java.lang.Comparable b)
Compare two objects both of which may be null
|
static java.lang.String |
encodeXmlText(java.lang.String str,
boolean fromHtml)
Translate special characters from XML
|
static java.lang.String |
fromXmlText(java.lang.String str)
Translate special characters from XML (e.g.
|
static int[] |
getInts(java.lang.String str,
java.lang.String sep,
int base,
int defVal)
Return an array of integers given a delimited string (e.g.
|
static boolean |
isEqual(java.lang.Object a,
java.lang.Object b)
Compare two objects both of which may be null
|
static java.lang.Double |
parseDouble(java.lang.String data)
Convert a string to a double.
|
static java.lang.Double |
parseDouble(java.lang.String data,
java.lang.Double defaultValue)
Convert a string to a double.
|
static int |
parseInteger(int base,
java.lang.String data)
Convert a string to an integer.
|
static java.lang.Integer |
parseInteger(int base,
java.lang.String data,
java.lang.Integer defaultValue)
Convert a string to an integer, allowing for 0x prefix for hexadecimal values.
|
static int |
parseInteger(java.lang.String data)
Convert a string to an integer, allowing for 0x prefix for hexadecimal values.
|
static java.lang.Integer |
parseInteger(java.lang.String data,
java.lang.Integer defaultValue)
Convert a string to an integer, allowing for 0x prefix for hexadecimal values.
|
static void |
showError(int status,
java.lang.String message) |
static boolean |
sleep(int millis)
Sleep specified number of milliseconds.
|
static java.lang.String |
toHex(int v) |
static java.lang.String |
toHex(int v,
int minLen) |
static java.lang.String |
toXmlText(java.lang.String str)
Translate special characters to XML (e.g.
|
static boolean |
validateNodeName(java.lang.String newName) |
public static int[] getInts(java.lang.String str, java.lang.String sep, int base, int defVal)
str
- String to parsesep
- Separatorbase
- The base (e.g. 10 for decimal, 16 for hex, etc.)defVal
- Default value if number cannot be parsedpublic static boolean sleep(int millis)
millis
- Milliseconds to sleeppublic static java.lang.String toXmlText(java.lang.String str)
str
- String to translatepublic static java.lang.String fromXmlText(java.lang.String str)
str
- String to translatepublic static java.lang.String encodeXmlText(java.lang.String str, boolean fromHtml)
str
- String to translatefromHtml
- True the convert from XML to chars, False convert from chars to XMLpublic static java.lang.Double parseDouble(java.lang.String data, java.lang.Double defaultValue)
data
- The string representation of the doubledefaultValue
- The value to return if the string cannot be converted into a doublepublic static java.lang.Double parseDouble(java.lang.String data)
data
- The string representation of the doublepublic static java.lang.Integer parseInteger(java.lang.String data, java.lang.Integer defaultValue)
data
- The string representation of the integerdefaultValue
- The value to return if the string cannot be converted into an integer.public static int parseInteger(java.lang.String data)
data
- The string representation of the integerpublic static java.lang.Integer parseInteger(int base, java.lang.String data, java.lang.Integer defaultValue)
base
- The base (e.g. 10 for decimal, 16 for hex, etc.)data
- The string representation of the integerdefaultValue
- The value to return if the string cannot be converted into an integer.public static int parseInteger(int base, java.lang.String data)
base
- The base (e.g. 10 for decimal, 16 for hex, etc.)data
- The string representation of the integerpublic static boolean isEqual(java.lang.Object a, java.lang.Object b)
a
- Object 1b
- Object 2public static int compare(java.lang.Comparable a, java.lang.Comparable b)
a
- Object 1b
- Object 2public static java.lang.String toHex(int v)
public static java.lang.String toHex(int v, int minLen)
public static boolean validateNodeName(java.lang.String newName)
public static void showError(int status, java.lang.String message)