Package org.silverpeas.core.util.memory
Class MemoryData
- java.lang.Object
-
- org.silverpeas.core.util.memory.MemoryData
-
public class MemoryData extends Object
User: Yohann Chastagnier Date: 14/11/13
-
-
Constructor Summary
Constructors Constructor Description MemoryData(long byteSize)
MemoryData(BigDecimal byteSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BigDecimal
convertTo(BigDecimal value, MemoryUnit from, MemoryUnit to)
String
getBestDisplayValue()
String
getBestDisplayValueOnly()
MemoryUnit
getBestUnit()
BigDecimal
getBestValue()
String
getFormattedValue(MemoryUnit to)
String
getFormattedValueOnly(MemoryUnit to)
BigDecimal
getRoundedSizeConverted(MemoryUnit to)
BigDecimal
getSize()
Long
getSizeAsLong()
Gets the size in bytes.BigDecimal
getSizeConverted(MemoryUnit to)
-
-
-
Constructor Detail
-
MemoryData
public MemoryData(long byteSize)
-
MemoryData
public MemoryData(BigDecimal byteSize)
-
-
Method Detail
-
convertTo
public static BigDecimal convertTo(BigDecimal value, MemoryUnit from, MemoryUnit to)
-
getSize
public BigDecimal getSize()
-
getSizeAsLong
public Long getSizeAsLong()
Gets the size in bytes.- Returns:
- a long value.
-
getRoundedSizeConverted
public BigDecimal getRoundedSizeConverted(MemoryUnit to)
-
getSizeConverted
public BigDecimal getSizeConverted(MemoryUnit to)
-
getBestUnit
public MemoryUnit getBestUnit()
-
getBestValue
public BigDecimal getBestValue()
-
getBestDisplayValueOnly
public String getBestDisplayValueOnly()
-
getBestDisplayValue
public String getBestDisplayValue()
-
getFormattedValueOnly
public String getFormattedValueOnly(MemoryUnit to)
-
getFormattedValue
public String getFormattedValue(MemoryUnit to)
-
-