ch.randelshofer.util
Class SizeFormat
java.lang.Object
ch.randelshofer.util.SizeFormat
public class SizeFormat
- extends java.lang.Object
Formats size units into a human readable string.
- Version:
- 1.0 2010-06-20 Created.
- Author:
- Werner Randelshofer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SizeFormat
public SizeFormat()
setMaximumFractionDigits
public void setMaximumFractionDigits(int newValue)
setAlwaysIncludeBytes
public void setAlwaysIncludeBytes(boolean newValue)
setShortFormat
public void setShortFormat(boolean newValue)
setMebibyte
public void setMebibyte(boolean isMebibyte)
isMebibyte
public boolean isMebibyte()
format
public java.lang.String format(long w)
- Returns a medium version of the formatted string.
- Parameters:
w - Units in bytes.
- Returns:
- Formatted string.
getInstance
public static SizeFormat getInstance()