public class BytesFormat extends Format
Bytes
,
Long
, Integer
, or Short
based on the currently configured BytesDisplay
preference.Format.Field
Modifier and Type | Field and Description |
---|---|
static String |
DETAILED_DECIMAL_FORMAT
The default format string using for decimal byte values.
|
Constructor and Description |
---|
BytesFormat()
Create an instance with default behavior.
|
BytesFormat(Format encapsulatedNumberFormat,
Format encapsulatedDecimalFormat)
Create an instance with the behavior that if the display preference is
BytesDisplay.Bytes , always use
encapsulatedNumberFormat ; otherwise, use
encapsulatedDecimalFormat if the value is more than 1KB. |
Modifier and Type | Method and Description |
---|---|
StringBuffer |
format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
If
obj is an instance of Bytes, long, integer or short, then
consider the bytes display preference when formatting the value. |
static BytesFormat |
getInstance()
Return a new instance of a BytesFormat with default options.
|
Object |
parseObject(String source,
ParsePosition pos) |
clone, format, formatToCharacterIterator, parseObject
public static final String DETAILED_DECIMAL_FORMAT
public BytesFormat()
public BytesFormat(Format encapsulatedNumberFormat, Format encapsulatedDecimalFormat)
BytesDisplay.Bytes
, always use
encapsulatedNumberFormat
; otherwise, use
encapsulatedDecimalFormat
if the value is more than 1KB.public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
obj
is an instance of Bytes, long, integer or short, then
consider the bytes display preference when formatting the value.
Otherwise, format obj
using the default formatter.public Object parseObject(String source, ParsePosition pos)
parseObject
in class Format
public static BytesFormat getInstance()