|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.common.util.FormatUtils
public class FormatUtils
Format time, bytes, counts, dates, and transfer rates into human friendly form
Constructor Summary | |
---|---|
FormatUtils()
|
Method Summary | |
---|---|
static long |
getBytes(String size)
Parse bytes from a size string that ends with a unit of measure. |
static long |
getBytes(String size,
List<String> tokens,
int base)
|
protected static long |
getByteValue(String time,
String suffix,
long multiplier)
|
static String |
getCount(long count)
Return a formatted count |
static String |
getDate(Date date)
Return a formatted date |
static String |
getDate(long millis)
Return a formatted date |
static String |
getFormattedSize(long bytes,
Size size)
|
static long |
getMillis(String time)
Parse milliseconds from a time string that ends with a unit of measure. |
static long |
getMillis(String time,
List<String> tokens,
List<Long> multipliers)
|
static String |
getRate(long millis,
long bytes)
Given a number of bytes and the number of milliseconds it took to transfer that number of bytes, return bytes/s, KB/s, MB/s, GB/s, TB/s, PB/s, or EB/s as appropriate |
static String |
getSize(long bytes)
Given a number of bytes return bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, or exabytes as appropriate. |
static String |
getSize(long bytes,
Size unitOfMeasure)
Given a number of bytes return a string formatted into the unit of measure indicated |
static Size |
getSizeEnum(double bytes)
|
static String |
getThroughputInSeconds(long millis,
long count,
String label)
|
static String |
getTime(long millis)
Given milliseconds, return milliseconds, seconds, minutes, hours, days, or year as appropriate. |
protected static List<Long> |
getTimeMultipliers()
|
protected static long |
getTimeValue(String time,
String suffix,
long multiplier)
|
static Date |
parseDate(String date)
Parse a date from the string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormatUtils()
Method Detail |
---|
public static long getBytes(String size)
1 == 1 byte 1b == 1 byte 1k == 1 kilobyte == 1024 bytes == 1,024 bytes 1m == 1 megabyte == 1024^2 bytes == 1,048,576 bytes 1g == 1 gigabyte == 1024^3 bytes == 1,073,741,824 bytes 1t == 1 terabyte == 1024^4 bytes == 1,099,511,627,776 bytes 1p == 1 petabyte == 1024^5 bytes == 1,125,899,906,842,624 bytes 1e == 1 exabyte == 1024^6 bytes == 1,152,921,504,606,846,976 bytes
public static long getBytes(String size, List<String> tokens, int base)
protected static long getByteValue(String time, String suffix, long multiplier)
public static long getMillis(String time)
1 == 1 millisecond 1ms == 1 millisecond 1s == 1 second == 1000 milliseconds 1m == 1 minute == 60,000 milliseconds 1h == 1 hour == 3,600,000 milliseconds 1d == 1 day == 86,400,000 milliseconds 1y == 1 year == 31,536,000,000 milliseconds
public static long getMillis(String time, List<String> tokens, List<Long> multipliers)
protected static long getTimeValue(String time, String suffix, long multiplier)
public static Date parseDate(String date)
public static String getDate(long millis)
public static String getDate(Date date)
public static String getThroughputInSeconds(long millis, long count, String label)
public static String getRate(long millis, long bytes)
public static String getCount(long count)
count
public static String getTime(long millis)
public static String getSize(long bytes)
public static String getSize(long bytes, Size unitOfMeasure)
public static String getFormattedSize(long bytes, Size size)
public static Size getSizeEnum(double bytes)
protected static final List<Long> getTimeMultipliers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |