Top Description Fields Constructors Methods
ch.qos.logback.core.util

public Class FileSize

extends Object
Class Inheritance
Imports
java.util.regex.Matcher, .Pattern

Instances of this class represent the size of a file. Internally, the size is stored as long.

The valueOf method can convert strings such as "3 kb", "5 mb", into FileSize instances. The recognized unit specifications for file size are the "kb", "mb", and "gb". The unit name may be followed by an "s". Thus, "2 kbs" and "2 kb" are equivalent. In the absence of a time unit specification, byte is assumed.

Author
Ceki Gülcü

Field Summary

Modifier and TypeField and Description
private static final int
private static final Pattern
public static final long
public static final long
private static final String
public static final long
pack-priv final long
private static final int
private static final String

Constructor Summary

AccessConstructor and Description
public
FileSize(long size)

Method Summary

Modifier and TypeMethod and Description
public long
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static FileSize
valueOf(String fileSizeStr)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DOUBLE_GROUPback to summary
private static final int DOUBLE_GROUP
FILE_SIZE_PATTERNback to summary
private static final Pattern FILE_SIZE_PATTERN
GB_COEFFICIENTback to summary
public static final long GB_COEFFICIENT
KB_COEFFICIENTback to summary
public static final long KB_COEFFICIENT
LENGTH_PARTback to summary
private static final String LENGTH_PART
MB_COEFFICIENTback to summary
public static final long MB_COEFFICIENT
sizeback to summary
pack-priv final long size
UNIT_GROUPback to summary
private static final int UNIT_GROUP
UNIT_PARTback to summary
private static final String UNIT_PART

Constructor Detail

FileSizeback to summary
public FileSize(long size)

Method Detail

getSizeback to summary
public long getSize()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
valueOfback to summary
public static FileSize valueOf(String fileSizeStr)