|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.text.SizeFormat
public class SizeFormat
SizeFormat formats byte sizes into localized string representations.
| Field Summary | |
|---|---|
static int |
BYTE_UNIT
Byte unit |
static int |
DIGITS_FULL
Bitmask for full digits, e.g. |
static int |
DIGITS_MEDIUM
Bitmask for medium digits, e.g. |
static int |
DIGITS_SHORT
Bitmask for short digits, e.g. |
static int |
GIGABYTE_UNIT
Gigabyte unit |
static int |
INCLUDE_SPACE
Bitmask to include a space character to separate the digits and unit parts |
static int |
KILOBYTE_UNIT
Kilobyte unit |
static int |
MEGABYTE_UNIT
Megabyte unit |
static int |
ROUND_TO_KB
Bitmask to round any size < 1KB to 1KB (except 0 which will be 0 KB) |
static int |
TERABYTE_UNIT
Terabyte unit |
static int |
UNIT_LONG
Bitmask for short unit string, e.g. |
static int |
UNIT_NONE
Bitmask for no unit string |
static int |
UNIT_SHORT
Bitmask for short unit string, e.g. |
static int |
UNIT_SPEED
Bitmask to add '/s' (per second) to the returned String |
| Constructor Summary | |
|---|---|
SizeFormat()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
format(long size,
int format)
Returns a String representation of the given byte size. |
static long |
getUnitBytes(int unit)
Returns the size in bytes of the given byte unit, e.g. |
static java.lang.String |
getUnitString(int unit,
boolean speedUnit)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DIGITS_SHORT
public static final int DIGITS_MEDIUM
public static final int DIGITS_FULL
public static final int UNIT_NONE
public static final int UNIT_SHORT
public static final int UNIT_LONG
public static final int BYTE_UNIT
public static final int KILOBYTE_UNIT
public static final int MEGABYTE_UNIT
public static final int GIGABYTE_UNIT
public static final int TERABYTE_UNIT
public static final int UNIT_SPEED
public static final int INCLUDE_SPACE
public static final int ROUND_TO_KB
| Constructor Detail |
|---|
public SizeFormat()
| Method Detail |
|---|
public static java.lang.String format(long size,
int format)
size - the size to formatformat - format bitmask, see constant fields for allowed values
public static java.lang.String getUnitString(int unit,
boolean speedUnit)
public static long getUnitBytes(int unit)
1024 for KILOBYTE_UNIT.
unit - a unit constant, see constant fields for allowed values
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard