|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgcspy.utils.Utils
public class Utils
General utilities
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static int |
countChars(java.lang.String str,
char c)
Count the number of occurrences of a character in a string |
static int |
countLines(java.lang.String text)
Count the number of lines in a string |
static java.lang.String |
formatDate(java.util.Date date)
Format as a date |
static java.lang.String |
formatDateTime(java.util.Date date)
Format as a time and date |
static java.lang.String |
formatPercentage(double perc)
Format as a percentage |
static java.lang.String |
formatSize(double size)
Format as a size |
static java.lang.String |
formatSize(long size)
Format as a size |
static java.lang.String |
formatTime(java.util.Date date)
Format as a time |
static java.lang.String |
padLeft(java.lang.String str,
int len)
Pad a string to the left |
static java.lang.String |
padRight(java.lang.String str,
int len)
Pad a string to the right |
static void |
sleep(long millis)
Sleep for a period |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static java.lang.String formatPercentage(double perc)
perc
- the value to format
public static java.lang.String formatSize(long size)
size
- the value to format
public static java.lang.String formatSize(double size)
size
- the value to format
public static java.lang.String formatDate(java.util.Date date)
date
- The date
public static java.lang.String formatTime(java.util.Date date)
date
- the time to format
public static java.lang.String formatDateTime(java.util.Date date)
date
- the date to format
public static java.lang.String padLeft(java.lang.String str, int len)
str
- the stringlen
- the space in which to place the string
public static java.lang.String padRight(java.lang.String str, int len)
str
- the stringlen
- the space in which to place the string
public static int countChars(java.lang.String str, char c)
str
- the stringc
- the character
public static int countLines(java.lang.String text)
text
- The test
public static void sleep(long millis)
millis
- the period to sleep in milliseconds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |