|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.util.UtlUnit
public class UtlUnit
Utilities for unit conversion.
This class IS NOT intended to be used by end users.
Nested Class Summary | |
---|---|
static class |
UtlUnit.Bytes
Represents a unit represented in bytes. |
Constructor Summary | |
---|---|
UtlUnit()
|
Method Summary | |
---|---|
static String |
formatDuration(long duration,
TimeUnit unit)
Converts a duration in nanoseconds to a human readable string. |
static String |
readableBytesSize(long size)
Returns a readable string for the given number of bytes. |
static long |
toNumBytes(String size)
Converts a string to a number of bytes. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UtlUnit()
Method Detail |
---|
public static String readableBytesSize(long size)
size
- The size in bytes to convert.
public static long toNumBytes(String size)
size
- The size in bytes in String form.
public static final String formatDuration(long duration, TimeUnit unit)
The conversion displays the duration in the largest significant unit of days,hours,minutes,seconds,millis,micros, or nanos to 1 decimal point.
duration
- The duration to format.unit
- The time unit of the duration.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |