|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.silverpeas.util.UnitUtil
public class UnitUtil
Unit values handling tools
| Constructor Summary | |
|---|---|
UnitUtil()
|
|
| Method Summary | |
|---|---|
static BigDecimal |
convertAndRoundTo(MemoryData memoryData,
MemoryUnit to)
Converting a computer data storage value |
static BigDecimal |
convertAndRoundTo(TimeData timeData,
TimeUnit to)
Converting a time value |
static BigDecimal |
convertTo(BigDecimal byteValue,
MemoryUnit to)
Converting a computer data storage value (bytes) |
static BigDecimal |
convertTo(BigDecimal value,
MemoryUnit from,
MemoryUnit to)
Converting a computer data storage value |
static BigDecimal |
convertTo(BigDecimal millisecondValue,
TimeUnit to)
Converting a time value (milliseconds) |
static BigDecimal |
convertTo(BigDecimal value,
TimeUnit from,
TimeUnit to)
Converting a time value |
static long |
convertTo(long byteValue,
MemoryUnit to)
Converting a computer data storage value (bytes) |
static long |
convertTo(long value,
MemoryUnit from,
MemoryUnit to)
Converting a computer data storage value |
static long |
convertTo(long millisecondValue,
TimeUnit to)
Converting a time value (milliseconds) |
static long |
convertTo(long value,
TimeUnit from,
TimeUnit to)
Converting a time value |
static String |
formatMemSize(BigDecimal memSize)
Get the memory size with the suitable unit |
static String |
formatMemSize(BigDecimal memSize,
MemoryUnit from)
Get the memory size with the suitable unit |
static String |
formatMemSize(long memSize)
Get the memory size with the suitable unit |
static String |
formatMemSize(long memSize,
MemoryUnit from)
Get the memory size with the suitable unit |
static String |
formatTime(BigDecimal time)
Get the time with the suitable unit |
static String |
formatTime(BigDecimal time,
TimeUnit from)
Get the time with the suitable unit |
static String |
formatTime(long time)
Get the time with the suitable unit |
static String |
formatTime(long time,
TimeUnit from)
Get the time with the suitable unit |
static String |
formatValue(BigDecimal byteValue,
MemoryUnit to)
Format a byte memory value |
static String |
formatValue(BigDecimal value,
MemoryUnit from,
MemoryUnit to)
Format a memory value |
static String |
formatValue(BigDecimal millisecondValue,
TimeUnit to)
Format a millisecond time value |
static String |
formatValue(BigDecimal value,
TimeUnit from,
TimeUnit to)
Format a time value |
static String |
formatValue(long byteValue,
MemoryUnit to)
Format a byte memory value |
static String |
formatValue(long value,
MemoryUnit from,
MemoryUnit to)
Format a memory value |
static String |
formatValue(long millisecondValue,
TimeUnit to)
Format a millisecond time value |
static String |
formatValue(long value,
TimeUnit from,
TimeUnit to)
Format a time value |
static MemoryData |
getMemData(BigDecimal memSize)
Get the memory data |
static MemoryData |
getMemData(BigDecimal memSize,
MemoryUnit from)
Get the memory data |
static MemoryData |
getMemData(long memSize)
Get the memory data |
static MemoryData |
getMemData(long memSize,
MemoryUnit from)
Get the memory data |
static TimeData |
getTimeData(BigDecimal time)
Get the time data |
static TimeData |
getTimeData(BigDecimal time,
TimeUnit from)
Get the time data |
static TimeData |
getTimeData(long time)
Get the time data |
static TimeData |
getTimeData(long time,
TimeUnit from)
Get the time data |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnitUtil()
| Method Detail |
|---|
public static long convertTo(long byteValue,
MemoryUnit to)
byteValue - to -
public static BigDecimal convertTo(BigDecimal byteValue,
MemoryUnit to)
byteValue - to -
public static long convertTo(long value,
MemoryUnit from,
MemoryUnit to)
value - from - to -
public static BigDecimal convertTo(BigDecimal value,
MemoryUnit from,
MemoryUnit to)
value - from - to -
public static BigDecimal convertAndRoundTo(MemoryData memoryData,
MemoryUnit to)
memoryData - to -
public static String formatValue(long byteValue,
MemoryUnit to)
byteValue - to -
public static String formatValue(BigDecimal byteValue,
MemoryUnit to)
byteValue - to -
public static String formatValue(long value,
MemoryUnit from,
MemoryUnit to)
value - from - to -
public static String formatValue(BigDecimal value,
MemoryUnit from,
MemoryUnit to)
value - from - to -
public static String formatMemSize(long memSize)
memSize - size in bytes
public static String formatMemSize(BigDecimal memSize)
memSize - size in bytes
public static String formatMemSize(long memSize,
MemoryUnit from)
memSize - sizefrom - the unit of the given size
public static String formatMemSize(BigDecimal memSize,
MemoryUnit from)
memSize - sizefrom - the unit of the given size
public static MemoryData getMemData(long memSize)
memSize - size in bytes
public static MemoryData getMemData(BigDecimal memSize)
memSize - size in bytes
public static MemoryData getMemData(long memSize,
MemoryUnit from)
memSize - sizefrom - the unit of the given size
public static MemoryData getMemData(BigDecimal memSize,
MemoryUnit from)
memSize - sizefrom - the unit of the given size
public static long convertTo(long millisecondValue,
TimeUnit to)
millisecondValue - to -
public static BigDecimal convertTo(BigDecimal millisecondValue,
TimeUnit to)
millisecondValue - to -
public static long convertTo(long value,
TimeUnit from,
TimeUnit to)
value - from - to -
public static BigDecimal convertTo(BigDecimal value,
TimeUnit from,
TimeUnit to)
value - from - to -
public static BigDecimal convertAndRoundTo(TimeData timeData,
TimeUnit to)
timeData - to -
public static String formatValue(long millisecondValue,
TimeUnit to)
millisecondValue - to -
public static String formatValue(BigDecimal millisecondValue,
TimeUnit to)
millisecondValue - to -
public static String formatValue(long value,
TimeUnit from,
TimeUnit to)
value - from - to -
public static String formatValue(BigDecimal value,
TimeUnit from,
TimeUnit to)
value - from - to -
public static String formatTime(long time)
time - in milliseconds
public static String formatTime(BigDecimal time)
time - in milliseconds
public static String formatTime(long time,
TimeUnit from)
time - from - the unit of the given size
public static String formatTime(BigDecimal time,
TimeUnit from)
time - from - the unit of the given size
public static TimeData getTimeData(long time)
time - in milliseconds
public static TimeData getTimeData(BigDecimal time)
time - in milliseconds
public static TimeData getTimeData(long time,
TimeUnit from)
time - from - the unit of the given size
public static TimeData getTimeData(BigDecimal time,
TimeUnit from)
time - from - the unit of the given size
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||