public class UtilFns extends java.lang.Object implements OsConst, StringConstants, TimeConstants
OsConst.OsType
Modifier and Type | Field and Description |
---|---|
static int |
colorPropertyStringLength |
static java.lang.String |
DEF_SPECIAL_CHARS_STR
String of special characters for 'insertQuoteChars()' method.
|
static java.net.URL |
EMPTY_URL
Empty URL value, not null.
|
static java.lang.String[] |
FAKE_IP_ADDRS
List of IP addresses for 'getLocalHostName()' to try to ignore.
|
static java.util.TimeZone |
GMT_TIME_ZONE_OBJ
TimeZone object setup for "GMT".
|
static java.nio.charset.Charset |
ISO_8859_1
ISO Latin Alphabet No.
|
static java.lang.String |
newline
A static string containing the proper system-dependent value for the
"newline" character sequence.
|
static java.lang.String[] |
PUBLIC_IP_HOSTS
Public IP Hosts
|
static CfgPropValidator |
timeZoneValidator |
static java.nio.charset.Charset |
UTF_8
UTF-8
|
OS_MAC_TEXT, OS_WINDOWS_TEXT
ALPHA_CAP_CHARS, ALPHA_CHARS, ALPHA_LOW_CHARS, ALPHANUM_CHARS_STRING, ALPHANUMERIC_CHARS, BOOLEAN_FALSE_TEXT, BOOLEAN_TRUE_TEXT, DATE_FORMAT_AMPM_STR, DATE_FORMAT_RFC_822_STR, DATE_FORMAT24_STR, DEFAULT_JAVA_VERSION_STRING, DEFAULT_NULL_STR, DEFAULT_SEP_STR, EFLOAT_CHARS, EMPTY_CHARS, EMPTY_STRING, EMPTY_STRINGS, FLOAT_CHARS, HEX_ALPHA_CAP_CHARS, HEX_ALPHA_LOW_CHARS, HEX_CHARS, HEX_PREFIX, INTEGER_CHARS, INVALID_FILENAME_CHARS, MODIFIER_TEXT_ALT, MODIFIER_TEXT_CTRL, MODIFIER_TEXT_META, MODIFIER_TEXT_META_ALT, MODIFIER_TEXT_META_CTRL, NONE, QUOTE_STRING, SIGNED_EFLOAT_CHARS, SIGNED_FLOAT_CHARS, SIGNED_INT_CHARS, SMTP_ENCRYPTION_OPTIONS, SMTP_SERVER_AUTHENTICATION_NAME, SMTP_SERVER_AUTHENTICATION_TEXT, SPACE_STRING, SSL, SSL_KEY_STORE_PROP_KEY, SSL_KEY_STORE_TYPE_PROP_KEY, SSL_TRUST_STORE_PROP_KEY, SSL_TRUST_STORE_TYPE_PROP_KEY, STARTTLS, TLS, TOD_CHARS, UNKNOWN_STRING, US_ASCII, WHITE_SPACE_CHARS, WILDCARD_ALL_CHAR, WILDCARD_CHARS, WILDCARD_SINGLE_CHAR
HOURS_PER_DAY, MINUTES_PER_DAY, MINUTES_PER_HOUR, MS_PER_DAY, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND, SECONDS_PER_DAY, SECONDS_PER_MINUTE
Modifier and Type | Method and Description |
---|---|
static byte[] |
addAll(byte[]... arrays)
Add the arrays.
|
static boolean |
addAll(java.util.List oldList,
java.util.List newList,
int maxSize,
int index)
Add all the elements in new list to the old list.
|
static void |
addDataChangedListener(DataChangedListener listenerObj)
Registers the given 'DataChangedListener' object to be notified when the
data such as the default locale is changed.
|
static void |
beep()
Emits an audio beep.
|
static java.lang.String |
booleanToString(boolean b)
Converts the given boolean value to a string.
|
static java.lang.Boolean |
booleanValueOf(boolean b)
Converts the given boolean value to a Boolean.
|
static java.lang.Boolean |
booleanValueOf(java.lang.String s)
Converts the given string to a Boolean.
|
static java.lang.String |
capFirstLetter(java.lang.String str)
Returns a new version of the given string that has its first character
capitialized (if possible).
|
static java.lang.String |
charToString(char ch)
Returns a string containing the given single character.
|
static java.lang.String |
checkJavaVersion(java.lang.String minJavaVersionString)
Checks the current Java version and prints an error message to standard
error if any.
|
static boolean |
checkJavaVersion(java.lang.String javaVersionString,
java.lang.String minJavaVersionString)
Checks the specified Java version.
|
static java.lang.String |
checkJavaVersion(java.lang.String javaVersionString,
java.lang.String minJavaVersionString,
java.lang.Appendable error)
Checks the specified Java version.
|
static void |
clear(char[] array)
Clear the array.
|
static void |
closeQuietly(java.lang.AutoCloseable closeable)
Close the resource quietly ignoring any errors.
|
static void |
closeQuietly(java.io.Closeable closeable)
Close quietly ignoring any exceptions.
|
static void |
closeQuietly(java.util.zip.ZipFile zipFile)
Close quietly ignoring any exceptions.
|
static java.lang.String |
colorRGBToString(int colorRGBVal)
Converts the given integer color RGB value to a string name corresponding
to the color.
|
static java.lang.String |
colorRGBToString(int colorRGBVal,
boolean useHexFlag)
Converts the given integer color RGB value to a string name corresponding
to the color.
|
static java.lang.String |
colorToPropertyString(java.awt.Color colorObj)
Converts the given integer color value to a property string name
corresponding to the color.
|
static int |
compare(char[] ca1,
char[] ca2)
Compares two character arrays lexicographically.
|
static int |
compare(char[] ca1,
int index1,
char[] ca2,
int index2)
Compares two character arrays lexicographically.
|
static int |
compare(java.lang.CharSequence cs1,
java.lang.CharSequence cs2)
Compares two character sequences lexicographically.
|
static int |
compare(java.lang.CharSequence cs1,
int index1,
java.lang.CharSequence cs2,
int index2)
Compares two character sequences lexicographically.
|
static int |
compareVersionNumbers(int[] version1,
int[] version2)
Compares two version number values.
|
static int |
compareVersionStrings(java.lang.String ver1Str,
java.lang.String ver2Str)
Compares two version strings containing version number values separated by
periods ('.') or '_' ('.').
|
static int |
compVersionStrs(java.lang.String ver1Str,
java.lang.String ver2Str)
Compares version strings.
|
static int |
compVersionStrs(java.lang.String ver1Str,
java.lang.String ver2Str,
int def1Val,
int bothNullVal)
Compares version strings.
|
static boolean |
contains(java.lang.Object[] a,
java.lang.Object value)
Determines if the array contains the specified value.
|
static java.lang.String |
createCenteredString(java.lang.String inString,
int fieldLen)
Returns a "centered" version of the given string.
|
static java.text.DateFormat |
createDateFormatObj(java.lang.String patternStr)
Creates a 'DateFormat' object and applies the given pattern string to it.
|
static java.text.DateFormat |
createDateFormatObj(java.lang.String patternStr,
java.util.Locale localeObj)
Creates a 'DateFormat' object and applies the given pattern string to it.
|
static java.text.DateFormat |
createDateFormatObj(java.lang.String patternStr,
java.util.TimeZone timeZoneObj)
Creates a 'DateFormat' object and applies the given pattern string to it.
|
static java.text.DateFormat |
createDateFormatObj(java.lang.String patternStr,
java.util.TimeZone timeZoneObj,
java.util.Locale localeObj)
Creates a 'DateFormat' object and applies the given pattern string to it.
|
static java.text.NumberFormat |
createFloatNumberFormat()
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(int numDigits)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(int minDigits,
int maxDigits)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(int minDigits,
int maxDigits,
java.util.Locale localeObj)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(int numDigits,
java.util.Locale localeObj)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(java.util.Locale localeObj)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(java.lang.String patternStr)
Creates a float number formatter.
|
static java.text.NumberFormat |
createFloatNumberFormat(java.lang.String patternStr,
java.util.Locale localeObj)
Creates a float number formatter.
|
static java.util.Timer |
createNamedTimerObj(java.lang.String nameStr,
boolean daemonFlag)
Creates a new "java.util.Timer" object whose associated thread has the
specified name, and may be specified to run as a daemon.
|
static java.lang.NumberFormatException |
createNumberFormatExceptionForInput(java.lang.CharSequence cs)
Factory method for making a
NumberFormatException given the
specified input which caused the error. |
static java.awt.Color |
createOpaqueColor(java.awt.Color colorObj)
Returns a fully opaque version of the given color (with alpha = 255).
|
static IstiTimer |
createTimer(java.lang.Runnable task,
long delay,
long period)
Create a timer using the EDT (Event Dispatch Thread) unless headless.
|
static IstiTimer |
createTimer(java.lang.Runnable task,
long delay,
long period,
boolean edtFlag)
Create a timer.
|
static java.net.URL |
createURL(java.lang.String spec)
Create the URL.
|
(package private) static int[] |
createVersionArray()
Create the version array.
|
static java.lang.String |
dateToRFC_822String(java.util.Date date)
Converts the given Date into a RFC-822 date/time string.
|
static java.lang.String |
durationMillisToString(long durationMs)
Returns a duration-time string for the given time value.
|
static java.lang.String |
durationMillisToString(long durationMs,
boolean showDaysFlag)
Returns a duration-time string for the given time value.
|
static java.lang.String |
durationMillisToString(long durationMs,
boolean showDaysFlag,
boolean showSecsFlag)
Returns a duration-time string for the given time value.
|
static java.lang.String |
durationMillisToString(long durationMs,
boolean showDaysFlag,
boolean showSecsFlag,
boolean verboseFlag)
Returns a duration-time string for the given time value.
|
static boolean |
endsWith(java.lang.String str,
java.lang.String suffix,
boolean ignoreCase)
Check if a string ends with a specified suffix (optionally case
insensitive).
|
static boolean |
endsWithIgnoreCase(java.lang.String str,
java.lang.String suffix)
Case insensitive check if a string ends with a specified prefix.
|
static java.util.Iterator |
enumToIterator(java.util.Enumeration e)
Converts the enumeration to an iterator.
|
static java.lang.String |
enumToListString(java.util.Enumeration e)
Returns a string representation of the data elements referenced by the
given enumeration.
|
static java.lang.String |
enumToQuotedStrings(java.util.Enumeration enumObj)
Returns a String of substrings gathered from the given enumeration.
|
static java.lang.String |
enumToQuotedStrings(java.util.Enumeration enumObj,
char sepChar,
boolean quoteCharsFlag)
Returns a String of substrings gathered from the given enumeration.
|
static java.lang.String |
enumToQuotedStrings(java.util.Enumeration enumObj,
java.lang.String sepStr,
boolean quoteCharsFlag)
Returns a String of substrings gathered from the given enumeration.
|
static java.lang.String |
enumToString(java.util.Enumeration e)
Returns a string representation of the data elements referenced by the
given enumeration.
|
static boolean |
equals(java.util.Map<java.lang.Object,java.lang.Object> first,
java.util.Map<java.lang.Object,java.lang.Object> second)
Determines if two maps are equal.
|
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Determines if two objects are equal.
|
static boolean |
equals(java.net.URL o1,
java.net.URL o2)
Determines if two URL objects are equal.
|
static java.lang.String |
fileNameToString(java.lang.String fNameStr)
Converts a file-name string that was encoded via 'stringToFileName()' back
to its original form.
|
static int |
findCharPos(java.lang.String str,
char ch)
Searches the entire given string for the position of the given character.
|
static int |
findCharPos(java.lang.String str,
char ch,
int startPos)
Searches the given string for the position of the given character.
|
static int |
findCharPos(java.lang.String str,
java.lang.String searchCharsStr)
Searches the given string for the first occurrence of any character in the
given search string.
|
static int |
findCharPos(java.lang.String str,
java.lang.String searchCharsStr,
int startPos)
Searches the given string for the first occurrence of any character in the
given search string.
|
static void |
fireDataChanged(java.lang.Object sourceObj)
Called to indicate that this object has changed.
|
static java.lang.String |
fixStringLen(java.lang.String inString,
int outLen)
Returns the given string "fixed" to the desired length, truncating or
adding spaces as necessary.
|
static java.lang.String |
fixStringLen(java.lang.String inString,
int outLen,
boolean rightJustFlag)
Returns the given string "fixed" to the desired length, truncating or
adding spaces as necessary.
|
static java.lang.String |
fixStringLen(java.lang.String inString,
int outLen,
boolean rightJustFlag,
boolean truncateFlag)
Returns the given string "fixed" to the desired length, (possibly)
truncating or adding spaces as necessary.
|
static java.lang.String |
floatNumberToPropertyString(java.lang.Object value)
Converts the given float number value to a property string.
|
static java.lang.String |
floatNumberToString(double value)
Converts the given float number value to a string where the value displayed
will be at least one fractional digit and will always be non-zero as long
as the value is greater than zero.
|
static java.lang.String |
floatNumberToString(double value,
int digits)
Converts the given float number value to a string.
|
static java.lang.String |
floatNumberToString(double value,
int digits,
int columns,
java.lang.Comparable maxValueObj)
Converts the given float number value to a string.
|
static long |
getAvailableMemory()
Returns the amount of available memory in the Java Virtual Machine.
|
static byte[] |
getBytes(java.nio.ByteBuffer bb)
Get the bytes.
|
static byte[] |
getBytes(char[] chars,
java.nio.charset.Charset charset)
Get the bytes.
|
static byte[] |
getBytes(java.lang.CharSequence cs,
java.nio.charset.Charset charset)
Get the bytes.
|
static char[] |
getChars(byte[] bytes,
java.nio.charset.Charset charset)
Get the characters.
|
static char[] |
getChars(java.lang.CharSequence cs)
Get the characters.
|
static java.nio.charset.Charset |
getCharset(java.lang.String charsetName,
java.nio.charset.Charset defaultCharset)
Get the character set.
|
static java.lang.String |
getClipboard()
Get the clip board contents.
|
static java.lang.String |
getColorDisplayName(int value)
Gets the display name for the specifed color value.
|
static int |
getColorDisplayNameIndex(int value)
Gets the display name index for the specifed color value.
|
static java.lang.String[] |
getColorDisplayNames()
Gets a list of string color display names.
|
static int |
getColorDisplayNameValue(int index)
Gets the value for the specified display name index.
|
static char |
getDecimalSeparator()
Gets the decimal separator character.
|
static java.util.Locale |
getDefaultLocale()
Gets the default locale.
|
static javax.net.ssl.SSLSocketFactory |
getDefaultSSLSocketFactory()
Gets the default
SSLSocketFactory . |
static long |
getFreeMemory()
Returns the amount of free memory in the Java Virtual Machine.
|
static java.lang.String |
getJavaVersion()
Gets the Java version.
|
static javax.swing.KeyStroke |
getKeyStroke(java.lang.String s)
Get the keystroke.
|
static java.net.InetAddress |
getLocalHostAddrObj()
Returns an Internet-address object for the local host.
|
static java.net.InetAddress |
getLocalHostAddrObj(boolean preferIP4Flag)
Returns an Internet-address object for the local host.
|
static java.net.InetAddress |
getLocalHostAddrObj(boolean preferIP4Flag,
java.lang.StringBuffer addrInfoBuff)
Returns an Internet-address object for the local host.
|
static java.lang.String |
getLocalHostIP()
Returns the local host IP.
|
static java.lang.String |
getLocalHostIP(java.net.InetAddress addrObj)
Returns the host IP address for the given address object.
|
static java.lang.String |
getLocalHostName()
Returns the local host name.
|
static java.lang.String |
getLocalHostName(java.net.InetAddress addrObj)
Returns the local host name.
|
static long |
getMaxMemory()
Returns the maximum amount of memory that the Java virtual machine will
attempt to use.
|
static void |
getMemoryInfo(java.lang.StringBuilder sb,
boolean humanReadble)
Get the memory information.
|
static java.lang.String |
getMemoryInfoStr()
Get the memory information.
|
static java.lang.String |
getOsName()
Get the OS name.
|
static OsConst.OsType |
getOsType()
Get the operating system type.
|
static java.lang.String |
getPrettyString(java.lang.String str)
Returns a pretty version of the specified string: Capatilizes the first
letter of every word.
|
static java.lang.String |
getPrettyString(java.lang.String str,
boolean allUpperFlag)
Returns a pretty version of the specified string: Replaces periods with
spaces.
|
static java.net.InetAddress |
getPublicIP(java.lang.String... publicIpHosts)
Get the public IP address.
|
static java.lang.ThreadGroup |
getRootThreadGroupObj()
Returns the root ThreadGroup object.
|
static java.lang.String |
getSpacerString(int numSpaces)
Returns a string containing the given number of space characters.
|
static java.lang.String |
getStackTraceString(java.lang.Throwable throwObj)
Fetches stack trace data from a throwable and returns it in a string.
|
static java.util.Locale |
getSystemLocale()
Gets the system locale.
|
static long |
getSystemTimeSec()
Returns the current time in seconds since midnight, January 1, 1970 UTC.
|
static java.lang.String |
getTableContentsString(java.util.Map tableObj)
Creates a string of "key" = "value" items from the given table/map, with ",
" separating the items.
|
static java.lang.String |
getTableContentsString(java.util.Map tableObj,
java.lang.String sepStr)
Creates a string of "key" = "value" items from the given table/map.
|
static java.lang.String[] |
getTimeZoneIDs()
Gets all the available time zone IDs supported.
|
static long |
getTotalMemory()
Returns the total amount of memory in the Java virtual machine.
|
static int |
getTotalThreadCount()
Returns a count of the total number of threads in the JVM.
|
static void |
getTrustStoreType(java.lang.StringBuilder sb,
java.lang.String def,
java.lang.String... prefixStrings)
Get the trust store type.
|
static java.lang.String |
getTrustStoreType(java.lang.String def,
java.lang.String... prefixStrings)
Get the trust store type.
|
static long |
getUsedMemory()
Get the amount of used memory in the Java Virtual Machine.
|
static java.lang.String |
getUserConsoleString()
Inputs a line of data from the user console (System.in).
|
static int |
indexOfNonWhitespace(java.lang.String str)
Searches the given string for the first occurrence of a non-whitespace
character.
|
static int |
indexOfNonWhitespace(java.lang.String str,
int startPos)
Searches the given string for the first occurrence of a non-whitespace
character.
|
static int |
indexOfWhitespace(java.lang.String str)
Searches the given string for the first occurrence of a whitespace
character.
|
static int |
indexOfWhitespace(java.lang.String str,
int startPos)
Searches the given string for the first occurrence of a whitespace
character.
|
static boolean |
insertQuoteChars(java.lang.StringBuilder sb,
java.lang.String specialChars)
Returns a string with a backslash quote character ('\') inserted in front
of each occurrence of a "special" character in the given source string.
|
static java.lang.String |
insertQuoteChars(java.lang.String dataStr,
java.lang.String specialChars)
Returns a string with a backslash quote character ('\') inserted in front
of each occurrence of a "special" character in the given source string.
|
static long |
intTimeToLong(int intTime)
Converts a 32-bit integer value to a 64-bit long as if the value is
unsigned.
|
static boolean |
isBlank(java.lang.String str)
Checks if a string is blank (trimmed to "" or null).
|
static boolean |
isEmpty(java.lang.String str)
Checks if a string is empty ("" or null).
|
static boolean |
isFakeIPAddress(java.lang.String str)
Returns true if the given string contains a "fake" IP address (one that
cannot be used as a "real" Internet address).
|
static boolean |
isHeadless()
Determines if headless.
|
static boolean |
isIPAddress(java.lang.String str)
Returns true if the contents of the given string qualify as a valid IP
address (in the from #.#.#.#); otherwise returns false.
|
static boolean |
isMac()
Determines if the operating system type is Mac.
|
static boolean |
isTrustAllCerts()
Determines if trusting all certificates.
|
static boolean |
isUnix()
Determines if the operating system type is Unix.
|
static boolean |
isURLAddress(java.lang.String str)
Returns true if the contents of the given string qualify as a valid URL
address; otherwise returns false.
|
static boolean |
isValidFileNameChar(char ch)
Determines if the character is valid for a filename.
|
static boolean |
isWindows()
Determines if the operating system type is Windows.
|
static java.util.Enumeration |
iteratorToEnum(java.util.Iterator it)
Converts the iterator to an enumeration.
|
static int |
lastIndexOfNonWhitespace(java.lang.String str)
Searches the given string for the last occurrence of a non-whitespace
character.
|
static java.lang.String |
listObjToListStr(java.util.List listObj,
java.lang.String sepStr)
Returns a String of substrings gathered from the given list.
|
static java.util.Vector |
listStringToVector(java.lang.String str)
Returns a Vector of substrings from the given list string.
|
static java.util.Vector |
listStringToVector(java.lang.String str,
char sepChar,
boolean trimFlag)
Returns a Vector of substrings from the given list string.
|
static java.util.Properties |
load(java.util.Properties props,
java.io.File file,
java.nio.charset.Charset cs)
Load the properties from the specified file the specified character
encoding.
|
static java.util.Properties |
load(java.util.Properties props,
java.io.InputStream inputStream,
java.nio.charset.Charset cs)
Load the properties from the specified input stream with the specified
character encoding.
|
static java.util.Properties |
load(java.util.Properties props,
java.io.Reader reader)
Load the properties from the specified reader with the specified character
encoding.
|
static boolean |
moveListElement(java.util.List listObj,
int index,
java.lang.Object element)
Moves the specified element to the specified position in the specified list
if it already present, otherwise it adds it at the position.
|
static java.lang.String |
normalizeString(java.lang.String str)
Returns a new string with all surrounding whitespace removed and internal
whitespace normalized to a single space.
|
static java.time.LocalDate |
ofInstant(java.time.Instant instant,
java.time.ZoneId zone)
Obtains an instance of
LocalDate from an Instant and zone
ID. |
static Archivable |
parseArchivable(Archivable defaultValueObj,
java.lang.String dataStr)
Converts the given data string to an 'Archivable' object.
|
static Archivable |
parseArchivable(java.lang.Class valueClass,
java.lang.String dataStr)
Converts the given data string to an 'Archivable' object.
|
static java.awt.Color |
parseColor(java.lang.String colorString)
Converts the given property string name to a color value.
|
static int |
parseInt(java.lang.CharSequence cs)
Parses the character sequence argument as a signed decimal integer.
|
static int |
parseInt(java.lang.CharSequence cs,
int start,
int end)
Parses the character sequence argument as a signed decimal integer.
|
static int |
parseInt(java.lang.CharSequence cs,
int start,
int end,
int radix,
boolean lenientFlag)
Parses the character sequence argument as a signed integer in the radix
specified by the second argument.
|
static java.lang.Integer |
parseInteger(java.lang.String s)
Parse the text for an integer.
|
static int |
parseLeadingInt(java.lang.String numStr)
Parses the leading digits of string as an integer while ignoring any
trailing non-digit characters.
|
static java.lang.Long |
parseLong(java.lang.String s)
Parse the text for a long integer.
|
static java.lang.Number |
parseNumber(java.lang.String str)
Converts the given string to a 'Number' object.
|
static java.lang.Number |
parseNumber(java.lang.String str,
java.lang.Class valueClass)
Converts the given string to a 'Number' object.
|
static java.lang.Object |
parseObject(java.lang.Class valueClass,
java.lang.String dataStr)
Converts the given data string to an object.
|
static java.lang.Object |
parseObject(java.lang.Class valueClass,
java.lang.String dataStr,
java.lang.String name,
java.lang.Class<?>... parameterTypes)
Converts the given data string to an object.
|
static java.lang.Object |
parseObject(java.lang.Object defaultValueObj,
java.lang.String dataStr)
Converts the given data string to an object.
|
static java.lang.String[] |
parseSeparatedSubstrings(java.lang.String dataStr,
java.lang.String sepStr)
Parses a string of substrings using the given separator.
|
static java.lang.String[] |
parseSeparatedSubstrings(java.lang.String dataStr,
java.lang.String sepStr,
char quoteChar,
boolean trimFlag)
Parses a string of substrings using the given separator.
|
static java.lang.String[] |
parseSeparatedSubstrings(java.lang.String dataStr,
java.lang.String sepStr,
char quoteChar,
boolean trimFlag,
boolean removeQuotesFlag)
Parses a string of substrings using the given separator.
|
static java.util.ArrayList |
parseSeparatedSubstrsToList(java.lang.String dataStr,
java.lang.String sepStr)
Parses a string of substrings using the given separator.
|
static java.util.ArrayList |
parseSeparatedSubstrsToList(java.lang.String dataStr,
java.lang.String sepStr,
char quoteChar,
boolean trimFlag)
Parses a string of substrings using the given separator.
|
static java.util.ArrayList |
parseSeparatedSubstrsToList(java.lang.String dataStr,
java.lang.String sepStr,
char quoteChar,
boolean trimFlag,
boolean removeQuotesFlag)
Parses a string of substrings using the given separator.
|
static java.util.Date |
parseStringToDate(java.lang.String s)
Parses the given time value string using the 24-hour clock format and the
local time zone.
|
static java.util.Date |
parseStringToDate(java.lang.String s,
boolean gmtFlag)
Parses the given time value string using the 24-hour clock format.
|
static java.util.Date |
parseStringToDate(java.lang.String dateStr,
boolean gmtFlag,
boolean amPmFlag)
Parses the given time value string.
|
static java.util.Calendar |
parseTime(java.lang.String timeStr,
java.util.Date date)
Parses the given time string.
|
static java.util.TimeZone |
parseTimeZoneID(java.lang.String id)
Parses the time zone ID property.
|
static int[] |
parseVersionNumbers(java.lang.String verStr)
Parses a version string into integer values.
|
(package private) static void |
parseVersionNumbers(java.lang.String verStr,
int[] version)
Parses a version string into integer values.
|
static java.util.Vector |
quotedStringsToVector(java.lang.String str)
Returns a Vector of substrings from the given string.
|
static java.util.Vector |
quotedStringsToVector(java.lang.String str,
char sepChar)
Returns a Vector of substrings from the given string.
|
static java.util.Vector |
quotedStringsToVector(java.lang.String str,
char sepChar,
boolean strictFlag)
Returns a Vector of substrings from the given string.
|
static java.util.Vector |
quotedStringsToVector(java.lang.String str,
java.lang.String sepCharsStr,
boolean strictFlag)
Returns a Vector of substrings from the given string.
|
static void |
removeDataChangedListener(DataChangedListener listenerObj)
Unregisters the given 'DataChangedListener' object from the list of
listeners for data.
|
static java.util.Vector |
removeEmptyStrings(java.util.Vector vec)
Removes items from the given Vector that are empty string or null.
|
static java.lang.String |
removeNonAlphanumChars(java.lang.String str)
Returns a new string with all non-alphnumeric characters removed.
|
static java.lang.String |
removeQuoteChars(java.lang.String dataStr)
Removes the backslash quote characters ('\') put in by
'insertQuoteChars()'.
|
static java.lang.String |
removeQuoteChars(java.lang.String dataStr,
boolean removeDblFlag)
Removes the backslash quote characters ('\') put in by
'insertQuoteChars()'.
|
static java.lang.String |
removeSpecifiedChars(java.lang.String str,
java.lang.String keepCharsStr)
Returns a new string with all characters not matching the given
keep-characters string removed.
|
static java.lang.String |
replaceAllSubstrings(java.lang.String dataStr,
java.lang.String oldStr,
java.lang.String newStr)
Replace all of the occurrences of a given substring with a new substring.
|
static java.lang.String |
replaceSubstring(java.lang.String dataStr,
java.lang.String oldStr,
java.lang.String newStr)
Replace the first occurrence of a given substring with a new substring.
|
static int |
runCommand(java.lang.String... command)
Run a command.
|
static int |
search(java.lang.Object[] a,
java.lang.Object value)
Searches the specified array for the specified value.
|
static void |
setClipboard(java.lang.String data)
Set the clip board contents.
|
static boolean |
setDateFormatPattern(java.text.DateFormat formatObj,
java.lang.String patternStr)
Sets the pattern string for the given 'DateFormat' object.
|
static void |
setDateFormatSymbols(java.text.DateFormat formatObj,
java.text.DateFormatSymbols newSymbols)
Sets the date format symbols for the date format object.
|
static void |
setDecimalFormatSymbols(java.text.NumberFormat formatObj,
java.text.DecimalFormatSymbols newSymbols)
Sets the decimal format symbols for the number format object.
|
static void |
setDefaultLocale(java.util.Locale localeObj)
Sets the default locale.
|
static javax.net.ssl.SSLSocketFactory |
setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory sf)
Sets the default
SSLSocketFactory . |
static java.net.URL |
setURLReference(java.net.URL urlObj,
java.lang.String refStr)
Creates a new URL containing the given reference (anchor) string.
|
static java.lang.String |
shortClassString(java.lang.Class classObj)
Converts the given Class object to "short" String name (with "java.lang."
removed).
|
static boolean |
sleep(long millisecs)
Delays for the given number of milliseconds.
|
static java.lang.String |
softWordWrapString(java.lang.String srcStr,
int lineWidth,
java.lang.String indentStr)
Performs a "soft" word-wrap of the given data.
|
static java.lang.String |
softWordWrapString(java.lang.String srcStr,
int lineWidth,
java.lang.String indentStr,
java.lang.String newLineStr)
Performs a "soft" word-wrap of the given data.
|
static java.lang.String |
softWordWrapString(java.lang.String srcStr,
int lineWidth,
java.lang.String indentStr,
java.lang.String newLineStr,
java.lang.String sepCharsStr)
Performs a "soft" word-wrap of the given data.
|
static void |
split(java.lang.String str,
java.util.Collection collection,
char sepChar,
boolean trim)
Split the text in the string into the collection.
|
static void |
split(java.lang.String str,
java.util.Collection collection,
char sepChar,
boolean trim,
boolean addEmpty)
Split the text in the string into the collection.
|
static boolean |
startsWith(java.lang.String str,
java.lang.String prefix,
boolean ignoreCase)
Check if a string starts with a specified prefix (optionally case
insensitive).
|
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String prefix)
Case insensitive check if a string starts with a specified prefix.
|
static java.lang.String |
stringArrayToString(java.lang.String[] strArr)
Converts an array of strings to a single string containing all the strings
in the array (each separated by a space).
|
static java.lang.String |
stringArrayToString(java.lang.String[] strArr,
java.lang.String sepStr)
Converts an array of strings to a single string containing all the strings
in the array.
|
static boolean |
stringToBoolean(java.lang.String s)
Converts the given string to a boolean value.
|
static boolean |
stringToBoolean(java.lang.String s,
boolean defaultValue)
Converts the given string to a boolean value.
|
static java.lang.Integer |
stringToColorRGB(java.lang.String str)
Converts the given string to the integer RGB representation of the
corresponding color.
|
static java.lang.Integer |
stringToColorRGB(java.lang.String str,
boolean tryRGBFlag)
Converts the given color name string to the integer RGB representation of
the corresponding color.
|
static java.lang.String |
stringToFileName(java.lang.String str)
Converts the given string to a string that is safe to use as a file name.
|
static java.lang.String |
strip(java.lang.String s)
Returns a string whose value is this string, with all leading and trailing
white space removed. |
static java.lang.String |
stripBrackets(java.lang.String str)
Returns a new string created by stripping the bracket characters from
around the given string.
|
static java.lang.String |
stripChar(java.lang.String str,
char ch)
Removes all occurrences of the given character from the given string.
|
static java.lang.String |
stripLeading(java.lang.String s)
Returns a string whose value is this string, with all leading
white space removed. |
static java.lang.String |
stripTrailing(java.lang.String s)
Returns a string whose value is this string, with all trailing
white space removed. |
static java.lang.String |
stripTrailingNewline(java.lang.String dataStr)
Removes a newline from the end of a "data" string.
|
static java.lang.String |
stripTrailingString(java.lang.String dataStr,
java.lang.String stripStr)
Removes a given "strip" string from the end of a "data" string.
|
static java.lang.String |
timeMillisToRFC_822String(long millis)
Converts the given integer time value to a RFC-822 date/time string.
|
static java.lang.String |
timeMillisToString()
Converts the current time value to a date/time string using the 24-hour
clock format and the local time zone.
|
static java.lang.String |
timeMillisToString(long millis)
Converts the given integer time value to a date/time string using the
24-hour clock format and the local time zone.
|
static java.lang.String |
timeMillisToString(long millis,
boolean gmtFlag)
Converts the given integer time value to a date/time string using the
24-hour clock format.
|
static java.lang.String |
timeMillisToString(long millis,
boolean gmtFlag,
boolean amPmFlag)
Converts the given integer time value to a date/time string.
|
static void |
toGlobalLogFileWarn(java.lang.String msgStr)
Sends the given message to the "global" log file object.
|
static java.lang.String |
toHexString(int i,
int numDigits)
Creates a string representation of the integer argument as an unsigned
integer in base-16.
|
static void |
toHumanReadable(java.lang.StringBuilder sb,
long numbytes,
SizeUnit... sizeUnits)
Gets the human readable text for the number of bytes.
|
static java.util.List |
toList(java.lang.Object[] a)
Get a fixed-size list backed by the specified array.
|
static java.lang.String |
toString(java.lang.Object obj)
Get the string representation of the
Object argument using the
default separator string. |
static java.lang.String |
toString(java.lang.Object obj,
java.lang.String nullStr)
Get the string representation of the
Object argument without a
separator string. |
static java.lang.String |
toString(java.lang.Object obj,
java.lang.String nullStr,
java.lang.String sepStr)
Get the string representation of the
Object argument using the
specified separator string. |
static java.lang.String |
toString(java.lang.Object obj,
java.lang.String nullStr,
java.lang.String sepStr,
java.util.Collection all)
Get the string representation of the
Object argument using the
specified separator string. |
static long |
toUnsignedLong(int x)
Converts the argument to a
long by an unsigned conversion. |
static java.lang.String |
trimEndStr(java.lang.String str)
Trims whitespace at the end of the given string.
|
static java.lang.String |
trimMultiLineString(java.lang.String inString)
Trims leading and trailing whitespace from each line inside of the given
string (while retaining the line separations).
|
static java.lang.String |
trimMultiLineString(java.lang.String inString,
int centerFieldLen)
Trims leading and trailing whitespace from each line inside of the given
string (while retaining the line separations).
|
static java.lang.String |
trimMultiLineString(java.lang.String inString,
java.lang.String newLineStr)
Trims leading and trailing whitespace from each line inside of the given
string (while retaining the line separations).
|
static java.lang.String |
trimMultiLineString(java.lang.String inString,
java.lang.String newLineStr,
int centerFieldLen)
Trims leading and trailing whitespace from each line inside of the given
string (while retaining the line separations).
|
static java.lang.String |
trustAllCerts()
Setup to trust all certificates if not already setup.
|
static void |
useWindowsCertificates()
Use the Windows certificates if no trust store type specified and Windows
operating system.
|
public static final int colorPropertyStringLength
public static final java.lang.String DEF_SPECIAL_CHARS_STR
public static final java.net.URL EMPTY_URL
public static final java.lang.String[] FAKE_IP_ADDRS
public static final java.util.TimeZone GMT_TIME_ZONE_OBJ
public static final java.nio.charset.Charset ISO_8859_1
public static final java.lang.String newline
public static java.lang.String[] PUBLIC_IP_HOSTS
#getPublicIP()
public static final CfgPropValidator timeZoneValidator
public static final java.nio.charset.Charset UTF_8
public static byte[] addAll(byte[]... arrays)
arrays
- the arrays.public static boolean addAll(java.util.List oldList, java.util.List newList, int maxSize, int index)
oldList
- the old list.newList
- the new list.maxSize
- the maximum size for the old list.index
- index at which to insert the first element.public static void addDataChangedListener(DataChangedListener listenerObj)
listenerObj
- the 'DataChangedListener' object.public static void beep()
public static java.lang.String booleanToString(boolean b)
b
- the boolean value.public static java.lang.Boolean booleanValueOf(boolean b)
b
- the boolean value.public static java.lang.Boolean booleanValueOf(java.lang.String s)
s
- the string representing the boolean value.public static java.lang.String capFirstLetter(java.lang.String str)
str
- the string to use.public static java.lang.String charToString(char ch)
ch
- the character to use.public static java.lang.String checkJavaVersion(java.lang.String minJavaVersionString)
javaVersionString
- the current Java version string.minJavaVersionString
- the minimum Java version string.getJavaVersion()
public static boolean checkJavaVersion(java.lang.String javaVersionString, java.lang.String minJavaVersionString)
javaVersionString
- the current Java version string.minJavaVersionString
- the minimum Java version string.getJavaVersion()
public static java.lang.String checkJavaVersion(java.lang.String javaVersionString, java.lang.String minJavaVersionString, java.lang.Appendable error)
javaVersionString
- the current Java version string.minJavaVersionString
- the minimum Java version string.error
- the object to append the error message to.getJavaVersion()
public static void clear(char[] array)
array
- the array.public static void closeQuietly(java.lang.AutoCloseable closeable)
closeable
- the resource or null if none.public static void closeQuietly(java.io.Closeable closeable)
closeable
- the object to be closed or null if none.public static void closeQuietly(java.util.zip.ZipFile zipFile)
zipFile
- the ZIP file to be closed or null if none.public static java.lang.String colorRGBToString(int colorRGBVal)
colorRGBVal
- the integer color RGB value to use.public static java.lang.String colorRGBToString(int colorRGBVal, boolean useHexFlag)
colorRGBVal
- RGB value of color.useHexFlag
- true if hex string should be used if no match.public static java.lang.String colorToPropertyString(java.awt.Color colorObj)
colorObj
- the color.public static int compare(char[] ca1, char[] ca2)
ca1
- the first character array.cs2
- the second character array.public static int compare(char[] ca1, int index1, char[] ca2, int index2)
ca1
- the first character array.index1
- the starting index for the first character array.cs2
- the second character array.index2
- the starting index for the second character array.public static int compare(java.lang.CharSequence cs1, java.lang.CharSequence cs2)
cs1
- the first character sequence.cs2
- the second character sequence.public static int compare(java.lang.CharSequence cs1, int index1, java.lang.CharSequence cs2, int index2)
cs1
- the first character sequence.index1
- the starting index for the first character sequence.cs2
- the second character sequence.index2
- the starting index for the second character sequence.public static int compareVersionNumbers(int[] version1, int[] version2)
version1
- the first version.version2
- the second version.parseVersionNumbers(String)
public static int compareVersionStrings(java.lang.String ver1Str, java.lang.String ver2Str)
ver1Str
- the first version string.ver2Str
- the second version string.parseVersionNumbers(String)
public static int compVersionStrs(java.lang.String ver1Str, java.lang.String ver2Str)
ver1Str
- first version string.ver2Str
- second version string.public static int compVersionStrs(java.lang.String ver1Str, java.lang.String ver2Str, int def1Val, int bothNullVal)
ver1Str
- first version string.ver2Str
- second version string.def1Val
- default value to be returned if first version string
contains no data (null or empty) and second version
string contains data.bothNullVal
- value to be returned if both version strings contain no
data (null or empty).public static boolean contains(java.lang.Object[] a, java.lang.Object value)
a
- the array to be searched.value
- the value to be searched for.public static java.lang.String createCenteredString(java.lang.String inString, int fieldLen)
inString
- the given string.fieldLen
- the field length for centering.public static java.text.DateFormat createDateFormatObj(java.lang.String patternStr)
patternStr
- the pattern string to apply.public static java.text.DateFormat createDateFormatObj(java.lang.String patternStr, java.util.Locale localeObj)
patternStr
- the pattern string to apply.localeObj
- the locale object.public static java.text.DateFormat createDateFormatObj(java.lang.String patternStr, java.util.TimeZone timeZoneObj)
patternStr
- the pattern string to apply.timeZoneObj
- timezone object to apply, or null or none.public static java.text.DateFormat createDateFormatObj(java.lang.String patternStr, java.util.TimeZone timeZoneObj, java.util.Locale localeObj)
patternStr
- the pattern string to apply.timeZoneObj
- timezone object to apply, or null or none.localeObj
- the locale object.public static java.text.NumberFormat createFloatNumberFormat()
public static java.text.NumberFormat createFloatNumberFormat(int numDigits)
numDigits
- the minimum and maximum number of fraction digits to be
shown.public static java.text.NumberFormat createFloatNumberFormat(int minDigits, int maxDigits)
minDigits
- the minimum number of fraction digits to be shown.maxDigits
- the maximum number of fraction digits to be shown.public static java.text.NumberFormat createFloatNumberFormat(int minDigits, int maxDigits, java.util.Locale localeObj)
minDigits
- the minimum number of fraction digits to be shown.maxDigits
- the maximum number of fraction digits to be shown.localeObj
- the locale object.public static java.text.NumberFormat createFloatNumberFormat(int numDigits, java.util.Locale localeObj)
numDigits
- the minimum and maximum number of fraction digits to be
shown.localeObj
- the locale object.public static java.text.NumberFormat createFloatNumberFormat(java.util.Locale localeObj)
localeObj
- the locale object.public static java.text.NumberFormat createFloatNumberFormat(java.lang.String patternStr)
patternStr
- the pattern string to apply.public static java.text.NumberFormat createFloatNumberFormat(java.lang.String patternStr, java.util.Locale localeObj)
patternStr
- the pattern string to apply.localeObj
- the locale object.public static java.util.Timer createNamedTimerObj(java.lang.String nameStr, boolean daemonFlag)
nameStr
- name for associated thread.daemonFlag
- true if associated thread should run as a daemon.public static java.lang.NumberFormatException createNumberFormatExceptionForInput(java.lang.CharSequence cs)
NumberFormatException
given the
specified input which caused the error.cs
- the input causing the errorpublic static java.awt.Color createOpaqueColor(java.awt.Color colorObj)
colorObj
- the Color object to use.public static IstiTimer createTimer(java.lang.Runnable task, long delay, long period)
task
- the task to run.delay
- delay in milliseconds before task is to be executed.period
- time in milliseconds between successive task executions.isHeadless()
public static IstiTimer createTimer(java.lang.Runnable task, long delay, long period, boolean edtFlag)
task
- the task to run.delay
- delay in milliseconds before task is to be executed.period
- time in milliseconds between successive task executions.edt
- true to use the EDT (Event Dispatch Thread), false otherwise.public static java.net.URL createURL(java.lang.String spec)
spec
- the String
to parse as a URL.static int[] createVersionArray()
public static final java.lang.String dateToRFC_822String(java.util.Date date)
date
- the time value to be formatted into a time string.public static java.lang.String durationMillisToString(long durationMs)
durationMs
- the number of milliseconds.public static java.lang.String durationMillisToString(long durationMs, boolean showDaysFlag)
durationMs
- the number of milliseconds.showDaysFlag
- if true and the number of hours is not less than 24
then the number of days is displayed; if false then the
total number of hours is always displayed.public static java.lang.String durationMillisToString(long durationMs, boolean showDaysFlag, boolean showSecsFlag)
durationMs
- the number of milliseconds.showDaysFlag
- if true and the number of hours is not less than 24
then the number of days is displayed; if false then the
total number of hours is always displayed.showSecsFlag
- if true then the number of seconds is included.public static java.lang.String durationMillisToString(long durationMs, boolean showDaysFlag, boolean showSecsFlag, boolean verboseFlag)
durationMs
- the number of milliseconds.showDaysFlag
- if true and the number of hours is not less than 24
then the number of days is displayed; if false then the
total number of hours is always displayed.showSecsFlag
- if true then the number of seconds is included.verboseFlag
- if true then show verbose text.public static boolean endsWith(java.lang.String str, java.lang.String suffix, boolean ignoreCase)
str
- the string to check or null.suffix
- the suffix to find or null.ignoreCase
- indicates whether the compare should ignore case (case
insensitive) or not.true
if the string ends with the suffix or both
null
String.endsWith(String)
public static boolean endsWithIgnoreCase(java.lang.String str, java.lang.String suffix)
null
s are handled without exceptions. Two null
references are considered to be equal. The comparison is case insensitive.
str
- the string to check or null.suffix
- the suffix to find or null.true
if the string ends with the suffix, case
insensitive, or both null
String.endsWith(String)
public static java.util.Iterator enumToIterator(java.util.Enumeration e)
e
- the enumeration.public static java.lang.String enumToListString(java.util.Enumeration e)
e
- the enumeration of data objects to use.public static java.lang.String enumToQuotedStrings(java.util.Enumeration enumObj)
enumObj
- the given enumeration.public static java.lang.String enumToQuotedStrings(java.util.Enumeration enumObj, char sepChar, boolean quoteCharsFlag)
enumObj
- the given enumeration.sepChar
- the character that separates the substrings.quoteCharsFlag
- if true then special characters, such as double-quote
and control characters, will be "quoted" in the
substrings using the backslash character (\r \n \t \\
\").public static java.lang.String enumToQuotedStrings(java.util.Enumeration enumObj, java.lang.String sepStr, boolean quoteCharsFlag)
enumObj
- the given enumeration.sepStr
- the string that separates the substrings.quoteCharsFlag
- if true then special characters, such as double-quote
and control characters, will be "quoted" in the
substrings using the backslash character (\r \n \t \\
\").public static java.lang.String enumToString(java.util.Enumeration e)
e
- the enumeration of data objects to use.public static boolean equals(java.util.Map<java.lang.Object,java.lang.Object> first, java.util.Map<java.lang.Object,java.lang.Object> second)
first
- the first map.second
- the second map.public static boolean equals(java.lang.Object o1, java.lang.Object o2)
o1
- the first object or null if none.o2
- the second object or null if none.public static boolean equals(java.net.URL o1, java.net.URL o2)
o1
- the first URL object or null if none.o2
- the second URL object or null if none.public static java.lang.String fileNameToString(java.lang.String fNameStr)
fNameStr
- file-name string to use.public static int findCharPos(java.lang.String str, char ch)
str
- the string to search.ch
- the character to search for.public static int findCharPos(java.lang.String str, char ch, int startPos)
str
- the string to search.ch
- the character to search for.startPos
- the position in the string to start searching from.public static int findCharPos(java.lang.String str, java.lang.String searchCharsStr)
str
- the string to search.searchCharsStr
- the string of search characters.public static int findCharPos(java.lang.String str, java.lang.String searchCharsStr, int startPos)
str
- the string to search.searchCharsStr
- the string of search characters.startPos
- the position in the string to start searching from.public static void fireDataChanged(java.lang.Object sourceObj)
sourceObj
- source object for the change.public static java.lang.String fixStringLen(java.lang.String inString, int outLen)
inString
- the given string.outLen
- the desired length of the output string.public static java.lang.String fixStringLen(java.lang.String inString, int outLen, boolean rightJustFlag)
inString
- the given string.outLen
- the desired length of the output string.rightJustFlag
- true for right-justified (spaces inserted before the
given string data); false for left-justified (spaces
added after the given string data).public static java.lang.String fixStringLen(java.lang.String inString, int outLen, boolean rightJustFlag, boolean truncateFlag)
inString
- the given string.outLen
- the desired length of the output string.rightJustFlag
- true for right-justified (spaces inserted before the
given string data); false for left-justified (spaces
added after the given string data).truncateFlag
- if true and the given string is longer than the
desired length then it is truncated to generate the
returned string; if false then the string data is
never truncated.public static java.lang.String floatNumberToPropertyString(java.lang.Object value)
value
- the number value.public static java.lang.String floatNumberToString(double value)
value
- the number value.public static java.lang.String floatNumberToString(double value, int digits)
value
- the number value.digits
- the maximum number of fraction digits to be shown.public static java.lang.String floatNumberToString(double value, int digits, int columns, java.lang.Comparable maxValueObj)
value
- the number value.digits
- the maximum number of fraction digits to be shown.columns
- the number of the columns for the string or 0 for no
limit.maxValueObj
- the maximum value object or null if not needed.public static long getAvailableMemory()
public static byte[] getBytes(java.nio.ByteBuffer bb)
bb
- the byte buffer.public static byte[] getBytes(char[] chars, java.nio.charset.Charset charset)
chars
- the characters.charset
- the character set.public static byte[] getBytes(java.lang.CharSequence cs, java.nio.charset.Charset charset)
cs
- the character sequence.charset
- the character set.public static char[] getChars(byte[] bytes, java.nio.charset.Charset charset)
bytes
- the bytes.charset
- the character set.public static char[] getChars(java.lang.CharSequence cs)
cs
- the character sequence.public static java.nio.charset.Charset getCharset(java.lang.String charsetName, java.nio.charset.Charset defaultCharset)
charsetName
- the character set name.defaultCharset
- the default character set or null for the default
character set of this Java virtual machine.public static java.lang.String getClipboard()
public static java.lang.String getColorDisplayName(int value)
value
- the RGB value of the color.getColorDisplayNames()
public static int getColorDisplayNameIndex(int value)
value
- the RGB value of the color.getColorDisplayNames()
public static java.lang.String[] getColorDisplayNames()
public static int getColorDisplayNameValue(int index)
index
- the display name index.getColorDisplayNames()
public static char getDecimalSeparator()
public static java.util.Locale getDefaultLocale()
addDataChangedListener, removeDataChangedListener
public static javax.net.ssl.SSLSocketFactory getDefaultSSLSocketFactory()
SSLSocketFactory
.SSLSocketFactory
trustAllCertsSSLSocketFactory
public static long getFreeMemory()
public static java.lang.String getJavaVersion()
public static javax.swing.KeyStroke getKeyStroke(java.lang.String s)
s
- the text for the keystroke.public static java.net.InetAddress getLocalHostAddrObj()
public static java.net.InetAddress getLocalHostAddrObj(boolean preferIP4Flag)
preferIP4Flag
- true to give preference to "valid" IPv4 addresses over
"valid" IPv6 addresses.public static java.net.InetAddress getLocalHostAddrObj(boolean preferIP4Flag, java.lang.StringBuffer addrInfoBuff)
preferIP4Flag
- true to give preference to "valid" IPv4 addresses over
"valid" IPv6 addresses.addrInfoBuff
- string buffer to be appended with informational text
on the host addresses that were found.public static java.lang.String getLocalHostIP()
public static java.lang.String getLocalHostIP(java.net.InetAddress addrObj)
addrObj
- Internet-address object.getLocalHostAddrObj
public static java.lang.String getLocalHostName()
public static java.lang.String getLocalHostName(java.net.InetAddress addrObj)
addrObj
- the Internet-address object.getLocalHostAddrObj
public static long getMaxMemory()
Long.MAX_VALUE
will be returned.public static void getMemoryInfo(java.lang.StringBuilder sb, boolean humanReadble)
sb
- the string builder to append the memory information.humanReadble
- true for human readable text, false for bytes.public static java.lang.String getMemoryInfoStr()
getMemoryInfo(StringBuilder, boolean)
public static java.lang.String getOsName()
public static OsConst.OsType getOsType()
public static java.lang.String getPrettyString(java.lang.String str)
str
- the string.public static java.lang.String getPrettyString(java.lang.String str, boolean allUpperFlag)
str
- the string.allUpperFlag
- true to have all words start with upper-case, false to
have only first word start with upper-case.public static java.net.InetAddress getPublicIP(java.lang.String... publicIpHosts)
publicIpHosts
- the public IP hosts or null / empty for the defaults.PUBLIC_IP_HOSTS
public static java.lang.ThreadGroup getRootThreadGroupObj()
public static java.lang.String getSpacerString(int numSpaces)
numSpaces
- the desired number of space characters.public static java.lang.String getStackTraceString(java.lang.Throwable throwObj)
throwObj
- the throwable object to use.public static java.util.Locale getSystemLocale()
public static long getSystemTimeSec()
public static java.lang.String getTableContentsString(java.util.Map tableObj)
tableObj
- the table/map object to use.public static java.lang.String getTableContentsString(java.util.Map tableObj, java.lang.String sepStr)
tableObj
- the table/map object to use.sepStr
- separator to put between items.public static java.lang.String[] getTimeZoneIDs()
public static long getTotalMemory()
public static int getTotalThreadCount()
public static java.lang.String getTrustStoreType(java.lang.String def, java.lang.String... prefixStrings)
def
- the default value or null to only get the trust store
type if specified.prefixStrings
- the prefix strings or none for the default.public static void getTrustStoreType(java.lang.StringBuilder sb, java.lang.String def, java.lang.String... prefixStrings)
sb
- the string builder.def
- the default value or null to only get the trust store
type if specified.prefixStrings
- the prefix strings or none for the default.public static long getUsedMemory()
public static java.lang.String getUserConsoleString()
public static int indexOfNonWhitespace(java.lang.String str)
str
- the string to search.public static int indexOfNonWhitespace(java.lang.String str, int startPos)
str
- the string to search.startPos
- the position at which to start the search.public static int indexOfWhitespace(java.lang.String str)
str
- the string to search.public static int indexOfWhitespace(java.lang.String str, int startPos)
str
- the string to search.startPos
- the position at which to start the search.public static java.lang.String insertQuoteChars(java.lang.String dataStr, java.lang.String specialChars)
dataStr
- the data source string.specialChars
- a string of "special" characters, each of which should
be quoted in the source string.public static boolean insertQuoteChars(java.lang.StringBuilder sb, java.lang.String specialChars)
sb
- the string builder containing the data source.specialChars
- a string of "special" characters, each of which should
be quoted in the source string.public static long intTimeToLong(int intTime)
intTime
- a time value in seconds.public static boolean isBlank(java.lang.String str)
str
- the string to check or null.true
if the string is blank (trimmed to "" or null).public static boolean isEmpty(java.lang.String str)
str
- the string to check or null.true
if the string is empty ("" or null).public static boolean isFakeIPAddress(java.lang.String str)
str
- the string to check.public static boolean isHeadless()
public static boolean isIPAddress(java.lang.String str)
str
- the string to check.public static boolean isMac()
public static boolean isTrustAllCerts()
public static boolean isUnix()
public static boolean isURLAddress(java.lang.String str)
str
- the string to check.public static boolean isValidFileNameChar(char ch)
ch
- the character to check.public static boolean isWindows()
public static java.util.Enumeration iteratorToEnum(java.util.Iterator it)
it
- the iterator.public static int lastIndexOfNonWhitespace(java.lang.String str)
str
- the string to search.public static java.lang.String listObjToListStr(java.util.List listObj, java.lang.String sepStr)
listObj
- source list of entries.sepStr
- separator string value.public static java.util.Vector listStringToVector(java.lang.String str)
str
- the source string.public static java.util.Vector listStringToVector(java.lang.String str, char sepChar, boolean trimFlag)
str
- the source string.sepChar
- the character that separates the substrings.trimFlag
- if true then all leading and trailing spaces in substrings
is trimmed.public static java.util.Properties load(java.util.Properties props, java.io.File file, java.nio.charset.Charset cs) throws java.io.IOException
Unlike java.util.Properties#load(Reader)
escape sequences are not
supported, the backslash character is not interpreted as a special
character and values cannot span multiple lines.
props
- the properties.inputStream
- the input stream.cs
- A charset or null for the default ISO 8859-1.java.io.IOException
- If an I/O error occurs#load(Properties, InputStream)
public static java.util.Properties load(java.util.Properties props, java.io.InputStream inputStream, java.nio.charset.Charset cs) throws java.io.IOException
Unlike java.util.Properties#load(Reader)
escape sequences are not
supported, the backslash character is not interpreted as a special
character and values cannot span multiple lines.
props
- the properties.inputStream
- the input stream.cs
- A charset or null for the default ISO 8859-1.java.io.IOException
- If an I/O error occurs#load(Properties, InputStream)
public static java.util.Properties load(java.util.Properties props, java.io.Reader reader) throws java.io.IOException
Unlike java.util.Properties#load(Reader)
escape sequences are not
supported, the backslash character is not interpreted as a special
character and values cannot span multiple lines.
props
- the properties.inputStream
- the input stream.java.io.IOException
- If an I/O error occurs#load(Properties, InputStream)
public static boolean moveListElement(java.util.List listObj, int index, java.lang.Object element)
index
is shifted upward to have an index one greater than the
value it had previously.
If the index is out of range the element is moved to the end of the list.
listObj
- the list object.index
- index at which the specified element is to be inserted.element
- element to be inserted.java.lang.UnsupportedOperationException
- if the add method is not
supported by the list.java.lang.ClassCastException
- if the class of the specified element
prevents it from being added to the
list.java.lang.IllegalArgumentException
- if some aspect of this element
prevents it from being added to the
list.public static java.lang.String normalizeString(java.lang.String str)
str
- the string to be normalized.public static java.time.LocalDate ofInstant(java.time.Instant instant, java.time.ZoneId zone)
LocalDate
from an Instant
and zone
ID.
This creates a local date based on the specified instant. First, the offset from UTC/Greenwich is obtained using the zone ID and instant, which is simple as there is only one valid offset for each instant. Then, the instant and offset are used to calculate the local date.
instant
- the instant to create the date from, not nullzone
- the time-zone, which may be an offset, not nullDateTimeException
- if the result exceeds the supported rangepublic static Archivable parseArchivable(Archivable defaultValueObj, java.lang.String dataStr)
defaultValueObj
- the 'Archivable' default value object.dataStr
- the data string.public static Archivable parseArchivable(java.lang.Class valueClass, java.lang.String dataStr)
valueClass
- the 'Archivable' value class.dataStr
- the data string.public static java.awt.Color parseColor(java.lang.String colorString) throws java.lang.NumberFormatException
colorString
- the property string for the color.java.lang.NumberFormatException
- if the specified string cannot be
interpreted as a color property string.public static int parseInt(java.lang.CharSequence cs)
'-'
(
'\u002D'
) to indicate a negative value. The resulting
integer value is returned, exactly as if the argument and the radix 10 were
given as arguments to the
parseInt(java.lang.CharSequence, int, int, int, boolean)
method.cs
- a CharSequence
containing the int
representation
to be parsedjava.lang.NumberFormatException
- if the character sequence does not contain
a parsable integer.public static int parseInt(java.lang.CharSequence cs, int start, int end)
'-'
(
'\u002D'
) to indicate a negative value. The resulting
integer value is returned, exactly as if the argument and the radix 10 were
given as arguments to the
parseInt(java.lang.CharSequence, int, int, int, boolean)
method.cs
- the CharSequence
containing the integer representation
to be parsedstart
- the start index.end
- the end index.java.lang.NumberFormatException
- if the character sequence does not contain
a parsable integer.public static int parseInt(java.lang.CharSequence cs, int start, int end, int radix, boolean lenientFlag) throws java.lang.NumberFormatException
Character.digit(char, int)
returns a nonnegative value),
except that the first character may be an ASCII minus sign '-'
('\u002D'
) to indicate a negative value or an ASCII plus
sign '+'
('\u002B'
) to indicate a positive value.
The resulting integer value is returned.
An exception of type NumberFormatException
is thrown if any of the
following situations occurs:
null
or is a character sequence of length
zero.
Character.MIN_RADIX
or larger than Character.MAX_RADIX
.
'-'
('\u002D'
) provided that the character sequence is longer
than length 1.
int
.
Examples:
parseInt("0", 10) returns 0 parseInt("473", 10) returns 473 parseInt("-0", 10) returns 0 parseInt("+0", 10) returns 0 parseInt("-FF", 16) returns -255 parseInt("1100110", 2) returns 102 parseInt("2147483647", 10) returns 2147483647 parseInt("-2147483648", 10) returns -2147483648 parseInt("2147483648", 10) throws a NumberFormatException parseInt("99", 8) throws a NumberFormatException parseInt("Kona", 10) throws a NumberFormatException parseInt("Kona", 27) returns 411787
cs
- the CharSequence
containing the integer
representation to be parsedstart
- the start index.end
- the end index.radix
- the radix to be used while parsing s
.lenientFlag
- true for lenient parsing, false otherwise.java.lang.NumberFormatException
- if the CharSequence
does not
contain a parsable int
.public static java.lang.Integer parseInteger(java.lang.String s)
s
- the text.public static int parseLeadingInt(java.lang.String numStr) throws java.lang.NumberFormatException
numStr
- the string to parse.java.lang.NumberFormatException
- if no valid numeric data is found.public static java.lang.Long parseLong(java.lang.String s)
s
- the text.public static java.lang.Number parseNumber(java.lang.String str)
str
- the string to convert.public static java.lang.Number parseNumber(java.lang.String str, java.lang.Class valueClass)
str
- the string to convert.valueClass
- the specific number class for the value.public static java.lang.Object parseObject(java.lang.Class valueClass, java.lang.String dataStr)
valueClass
- the value class.dataStr
- the data string.public static java.lang.Object parseObject(java.lang.Class valueClass, java.lang.String dataStr, java.lang.String name, java.lang.Class<?>... parameterTypes)
valueClass
- the value class.dataStr
- the data string.name
- the name of the method.parameterTypes
- the list of parameters.public static java.lang.Object parseObject(java.lang.Object defaultValueObj, java.lang.String dataStr)
defaultValueObj
- the default value object.dataStr
- the data string.public static java.lang.String[] parseSeparatedSubstrings(java.lang.String dataStr, java.lang.String sepStr)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string then "." is
used).public static java.lang.String[] parseSeparatedSubstrings(java.lang.String dataStr, java.lang.String sepStr, char quoteChar, boolean trimFlag)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string then "."
is used).quoteChar
- a quote character (i.e., '"') to be used at the beginning
and end of a substring, or a null ('\0') character for
none.trimFlag
- if true then leading and trailing whitespace will be
removed from the parsed substrings.public static java.lang.String[] parseSeparatedSubstrings(java.lang.String dataStr, java.lang.String sepStr, char quoteChar, boolean trimFlag, boolean removeQuotesFlag)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string
then "." is used).quoteChar
- a quote character (i.e., '"') to be used at the
beginning and end of a substring, or a null ('\0')
character for none.trimFlag
- if true then leading and trailing whitespace will
be removed from the parsed substrings.removeQuotesFlag
- if true then quote characters surrounding
substrings will be removed.public static java.util.ArrayList parseSeparatedSubstrsToList(java.lang.String dataStr, java.lang.String sepStr)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string then "." is
used).public static java.util.ArrayList parseSeparatedSubstrsToList(java.lang.String dataStr, java.lang.String sepStr, char quoteChar, boolean trimFlag)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string then "."
is used).quoteChar
- a quote character (i.e., '"') to be used at the beginning
and end of a substring, or a null ('\0') character for
none.trimFlag
- if true then leading and trailing whitespace will be
removed from the parsed substrings.public static java.util.ArrayList parseSeparatedSubstrsToList(java.lang.String dataStr, java.lang.String sepStr, char quoteChar, boolean trimFlag, boolean removeQuotesFlag)
dataStr
- the data string to parse.sepStr
- the separator string (if null or an empty string
then "." is used).quoteChar
- a quote character (i.e., '"') to be used at the
beginning and end of a substring, or a null ('\0')
character for none.trimFlag
- if true then leading and trailing whitespace will
be removed from the parsed substrings.removeQuotesFlag
- if true then quote characters surrounding
substrings will be removed.public static java.util.Date parseStringToDate(java.lang.String s)
s
- the time value string.public static java.util.Date parseStringToDate(java.lang.String s, boolean gmtFlag)
s
- the time value string.gmtFlag
- true for GMT time zone, false for local time zone.public static java.util.Date parseStringToDate(java.lang.String dateStr, boolean gmtFlag, boolean amPmFlag)
dateStr
- a date/time string in the form "MMM dd yyyy hh:mm:ss [a]
z".gmtFlag
- true for GMT time zone, false for local time zone.amPmFlag
- true for AM/PM clock, false for 24-hour clock.public static java.util.Calendar parseTime(java.lang.String timeStr, java.util.Date date)
timeStr
- the time string.date
- the date or null if none.public static java.util.TimeZone parseTimeZoneID(java.lang.String id)
id
- time zone ID.public static int[] parseVersionNumbers(java.lang.String verStr)
verStr
- the version string to be parsed.static void parseVersionNumbers(java.lang.String verStr, int[] version)
verStr
- the version string to be parsed.public static java.util.Vector quotedStringsToVector(java.lang.String str)
str
- the source string.public static java.util.Vector quotedStringsToVector(java.lang.String str, char sepChar)
str
- the source string.sepChar
- the character that separates the substrings.public static java.util.Vector quotedStringsToVector(java.lang.String str, char sepChar, boolean strictFlag)
str
- the source string.sepChar
- the character that separates the substrings.strictFlag
- if true then the string format is strictly
interpreted--no extraneous spaces are allowed and every
substring must be surrounded by double-quotes.public static java.util.Vector quotedStringsToVector(java.lang.String str, java.lang.String sepCharsStr, boolean strictFlag)
str
- the source string.sepCharsStr
- a string of separator characters that may be used to
separate the substrings, or null for " ,;".strictFlag
- if true then the string format is strictly
interpreted--no extraneous spaces are allowed and every
substring must be surrounded by double-quotes.public static void removeDataChangedListener(DataChangedListener listenerObj)
listenerObj
- the 'DataChangedListener' object.public static java.util.Vector removeEmptyStrings(java.util.Vector vec)
vec
- the given Vector.public static java.lang.String removeNonAlphanumChars(java.lang.String str)
str
- string to be processed.public static java.lang.String removeQuoteChars(java.lang.String dataStr)
dataStr
- the data source string.public static java.lang.String removeQuoteChars(java.lang.String dataStr, boolean removeDblFlag)
dataStr
- the data source string.removeDblFlag
- true to remove any surrounding pair of double-quote
characters ("") from string; false to leave them
alone.public static java.lang.String removeSpecifiedChars(java.lang.String str, java.lang.String keepCharsStr)
str
- string to be processed.keepCharsStr
- string of "keep" characters to be matched.public static java.lang.String replaceAllSubstrings(java.lang.String dataStr, java.lang.String oldStr, java.lang.String newStr)
dataStr
- the data string to be used.oldStr
- the "old" substring to be replaced.newStr
- the "new" substring to be entered.public static java.lang.String replaceSubstring(java.lang.String dataStr, java.lang.String oldStr, java.lang.String newStr)
dataStr
- the data string to be used.oldStr
- the "old" substring to be replaced.newStr
- the "new" substring to be entered.public static int runCommand(java.lang.String... command) throws java.io.IOException, java.lang.InterruptedException
command
- a valid operating system command.java.io.IOException
- if an I/O error occurs.java.lang.InterruptedException
- if the current thread is interrupted by
another thread.public static int search(java.lang.Object[] a, java.lang.Object value)
a
- the array to be searched.value
- the value to be searched for.public static void setClipboard(java.lang.String data)
data
- the string for the contents.public static boolean setDateFormatPattern(java.text.DateFormat formatObj, java.lang.String patternStr)
formatObj
- the 'DateFormat' to be changed.patternStr
- the pattern string to apply.public static void setDateFormatSymbols(java.text.DateFormat formatObj, java.text.DateFormatSymbols newSymbols)
formatObj
- the date format.newSymbols
- the date format symbols.public static void setDecimalFormatSymbols(java.text.NumberFormat formatObj, java.text.DecimalFormatSymbols newSymbols)
formatObj
- the number format.newSymbols
- the decimal format symbols.public static void setDefaultLocale(java.util.Locale localeObj)
localeObj
- the default locale.addDataChangedListener, removeDataChangedListener
public static javax.net.ssl.SSLSocketFactory setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory sf)
SSLSocketFactory
.sf
- the default SSLSocketFactory
.SSLSocketFactory
.trustAllCertsSSLSocketFactory
public static java.net.URL setURLReference(java.net.URL urlObj, java.lang.String refStr)
urlObj
- the URL object to use.refStr
- the reference (anchor) string to use, or null to specify no
reference.public static java.lang.String shortClassString(java.lang.Class classObj)
classObj
- a Class object.public static boolean sleep(long millisecs)
millisecs
- the number of milliseconds to delay.public static java.lang.String softWordWrapString(java.lang.String srcStr, int lineWidth, java.lang.String indentStr)
srcStr
- data string to use.lineWidth
- target line-width value.indentStr
- indentation to be put in front of generated lines (after
the first one), or null for none.public static java.lang.String softWordWrapString(java.lang.String srcStr, int lineWidth, java.lang.String indentStr, java.lang.String newLineStr)
srcStr
- data string to use.lineWidth
- target line-width value.indentStr
- indentation to be put in front of generated lines (after
the first one), or null for none.newLineStr
- string to use for generate line-ends.public static java.lang.String softWordWrapString(java.lang.String srcStr, int lineWidth, java.lang.String indentStr, java.lang.String newLineStr, java.lang.String sepCharsStr)
srcStr
- data string to use.lineWidth
- target line-width value.indentStr
- indentation to be put in front of generated lines (after
the first one), or null for none.newLineStr
- string to use for generate line-ends.sepCharsStr
- string of characters to be interpreted as word
separators, or null to use any character <= the space
character.public static void split(java.lang.String str, java.util.Collection collection, char sepChar, boolean trim)
str
- the string.collection
- the collection.sepChar
- the separator character.trim
- true to trim extra separator characters, false otherwise.public static void split(java.lang.String str, java.util.Collection collection, char sepChar, boolean trim, boolean addEmpty)
str
- the string.collection
- the collection.sepChar
- the separator character.trim
- true to trim extra separator characters, false otherwise.addEmpty
- true to add empty strings, false otherwise.public static boolean startsWith(java.lang.String str, java.lang.String prefix, boolean ignoreCase)
str
- the string to check or null.prefix
- the prefix to find or null.ignoreCase
- indicates whether the compare should ignore case (case
insensitive) or not.true
if the string starts with the prefix or both
null
String.startsWith(String)
public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String prefix)
null
s are handled without exceptions. Two null
references are considered to be equal. The comparison is case insensitive.
str
- the string to check or null.prefix
- the prefix to find or null.true
if the string starts with the prefix, case
insensitive, or both null
String.startsWith(String)
public static java.lang.String stringArrayToString(java.lang.String[] strArr)
strArr
- source array of strings.public static java.lang.String stringArrayToString(java.lang.String[] strArr, java.lang.String sepStr)
strArr
- source array of strings.sepStr
- separator string to use between source strings, or null or
none.public static boolean stringToBoolean(java.lang.String s)
s
- the string representing the boolean value.public static boolean stringToBoolean(java.lang.String s, boolean defaultValue)
s
- the string representing the boolean value.defaultValue
- the default value if the string is null.public static java.lang.Integer stringToColorRGB(java.lang.String str)
str
- the string to be converted.public static java.lang.Integer stringToColorRGB(java.lang.String str, boolean tryRGBFlag)
str
- the string to be converted.tryRGBFlag
- if true then and no color name match is found then the
method will attempt to interpret the string as a numeric
RGB value or values.public static java.lang.String stringToFileName(java.lang.String str)
str
- the string to be converted.public static java.lang.String strip(java.lang.String s)
white space
removed.s
- the stringpublic static java.lang.String stripBrackets(java.lang.String str)
str
- the string to use.public static java.lang.String stripChar(java.lang.String str, char ch)
str
- the given string.ch
- the character to be removed.public static java.lang.String stripLeading(java.lang.String s)
white space
removed.s
- the stringpublic static java.lang.String stripTrailing(java.lang.String s)
white space
removed.s
- the stringpublic static java.lang.String stripTrailingNewline(java.lang.String dataStr)
dataStr
- the data string to use.public static java.lang.String stripTrailingString(java.lang.String dataStr, java.lang.String stripStr)
dataStr
- the data string to use.stripStr
- the "strip" string to be removed.public static final java.lang.String timeMillisToRFC_822String(long millis)
millis
- a time in milliseconds since midnight, January 1, 1970 UTC.public static java.lang.String timeMillisToString()
public static java.lang.String timeMillisToString(long millis)
millis
- a time in milliseconds since midnight, January 1, 1970 UTC.public static java.lang.String timeMillisToString(long millis, boolean gmtFlag)
millis
- a time in milliseconds since midnight, January 1, 1970 UTC.gmtFlag
- true for GMT time zone, false for local time zone.public static java.lang.String timeMillisToString(long millis, boolean gmtFlag, boolean amPmFlag)
millis
- a time in milliseconds since midnight, January 1, 1970 UTC.gmtFlag
- true for GMT time zone, false for local time zone.amPmFlag
- true for AM/PM clock, false for 24-hour clock.public static void toGlobalLogFileWarn(java.lang.String msgStr)
msgStr
- message string to send out.public static java.lang.String toHexString(int i, int numDigits)
i
- an integer.numDigits
- the number of hex digits to pad if necessary.public static void toHumanReadable(java.lang.StringBuilder sb, long numbytes, SizeUnit... sizeUnits)
sb
- the string builder.numbytes
- the number of bytes.sizeUnits
- the size units or an empty array for all.public static java.util.List toList(java.lang.Object[] a)
a
- the array by which the list will be backed or null if none.public static java.lang.String toString(java.lang.Object obj)
Object
argument using the
default separator string.obj
- an Object
.null
, then a string equal to
"null"
; otherwise, the value of
obj.toString()
is returned.toString(Object, String, String, Collection)
public static java.lang.String toString(java.lang.Object obj, java.lang.String nullStr)
Object
argument without a
separator string.obj
- an Object
.nullStr
- the null stringnull
, then nullStr; otherwise, the
value of obj.toString()
is returned.public static java.lang.String toString(java.lang.Object obj, java.lang.String nullStr, java.lang.String sepStr)
Object
argument using the
specified separator string.obj
- an Object
.nullStr
- the null stringsepStr
- separator string value.null
, then nullStr; otherwise, the
value of obj.toString()
is returned.toString(Object, String, String, Collection)
public static java.lang.String toString(java.lang.Object obj, java.lang.String nullStr, java.lang.String sepStr, java.util.Collection all)
Object
argument using the
specified separator string.obj
- an Object
.nullStr
- the null stringsepStr
- separator string value.all
- a collection of all values for deep contents or null if
none.null
, then nullStr; otherwise, the
value of obj.toString()
is returned.#DEFAULT_NULL_TEXT
,
StringConstants.DEFAULT_SEP_STR
public static long toUnsignedLong(int x)
long
by an unsigned conversion. In an
unsigned conversion to a long
, the high-order 32 bits of the
long
are zero and the low-order 32 bits are equal to the bits of
the integer argument.
Consequently, zero and positive int
values are mapped to a
numerically equal long
value and negative int
values are mapped to a long
value equal to the input plus
232.x
- the value to convert to an unsigned long
long
by an unsigned conversionpublic static java.lang.String trimEndStr(java.lang.String str)
str
- string to use.public static java.lang.String trimMultiLineString(java.lang.String inString)
inString
- the given string.public static java.lang.String trimMultiLineString(java.lang.String inString, int centerFieldLen)
inString
- the given string.centerFieldLen
- the field length for centering, or 0 for no
centering.public static java.lang.String trimMultiLineString(java.lang.String inString, java.lang.String newLineStr)
inString
- the given string.newLineStr
- the newline separator to be used between lines in the
returned string.public static java.lang.String trimMultiLineString(java.lang.String inString, java.lang.String newLineStr, int centerFieldLen)
inString
- the given string.newLineStr
- the newline separator to be used between lines in the
returned string.centerFieldLen
- the field length for centering, or 0 for no
centering.public static java.lang.String trustAllCerts()
getDefaultSSLSocketFactory()
,
setDefaultSSLSocketFactory(SSLSocketFactory)
public static void useWindowsCertificates()