|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nhncorp.neptune.common.util.StringUtils
public class StringUtils
General string utils
| Constructor Summary | |
|---|---|
StringUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
arrayToString(java.lang.String[] strs)
Given an array of strings, return a comma-separated list of its elements. |
static java.lang.String |
byteToHexString(byte[] bytes)
Given an array of bytes it will convert the bytes to a hex string representation of the bytes |
static java.lang.String |
fillString(java.lang.String fillStr,
int size)
|
static java.lang.String |
formatPercent(double done,
int digits)
Format a percentage for presentation to the user. |
static java.lang.String |
formatTimeDiff(long finishTime,
long startTime)
Given a finish and start time in long milliseconds, returns a String in the format Xhrs, Ymins, Z sec, for the time difference between two times. |
static java.lang.String |
getFormattedTimeWithDiff(java.text.DateFormat dateFormat,
long finishTime,
long startTime)
Formats time in ms and appends difference (finishTime - startTime) as returned by formatTimeDiff(). |
static java.lang.String[] |
getStrings(java.lang.String str)
returns an arraylist of strings |
static byte[] |
hexStringToByte(java.lang.String hex)
Given a hexstring this will return the byte array corresponding to the string |
static java.lang.String |
humanReadableInt(long number)
Given an integer, return a string that is in an approximate, but human readable format. |
static java.lang.String |
simpleHostname(java.lang.String fullHostname)
Given a full hostname, return the word upto the first dot. |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String delim)
여러라인에 걸쳐 있는 문자열에 대해 token을 만든다. |
static java.lang.String |
stringifyException(java.lang.Throwable e)
Make a string representation of the exception. |
static java.net.URI[] |
stringToURI(java.lang.String[] str)
|
static java.lang.String |
substring(java.lang.String str,
int start,
int end)
|
static java.lang.String |
uriToString(java.net.URI[] uris)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtils()
| Method Detail |
|---|
public static java.lang.String stringifyException(java.lang.Throwable e)
e - The exception to stringify
public static java.lang.String simpleHostname(java.lang.String fullHostname)
fullHostname - the full hostname
public static java.lang.String humanReadableInt(long number)
number - the number to format
public static java.lang.String formatPercent(double done,
int digits)
done - the percentage to format (0.0 to 1.0)digits - the number of digits past the decimal point
public static java.lang.String arrayToString(java.lang.String[] strs)
strs - Array of strings
public static java.lang.String byteToHexString(byte[] bytes)
bytes -
public static byte[] hexStringToByte(java.lang.String hex)
hex - the hex String array
public static java.lang.String uriToString(java.net.URI[] uris)
uris - public static java.net.URI[] stringToURI(java.lang.String[] str)
str -
public static java.lang.String formatTimeDiff(long finishTime,
long startTime)
finishTime - finish timestartTime - start time
public static java.lang.String getFormattedTimeWithDiff(java.text.DateFormat dateFormat,
long finishTime,
long startTime)
dateFormat - date format to usefinishTime - fnish timestartTime - start time
public static java.lang.String[] getStrings(java.lang.String str)
str - the comma seperated string values
public static java.lang.String fillString(java.lang.String fillStr,
int size)
public static java.lang.String substring(java.lang.String str,
int start,
int end)
public static java.lang.String[] split(java.lang.String str,
java.lang.String delim)
str - delim -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||