public class NumberDateFormat extends NumberFormat
Format
parses Long
into date strings and vice-versa. It
uses the given DateFormat
to parse and format dates, but before, it
converts Long
to Date
objects or vice-versa.NumberFormat.Field
FRACTION_FIELD, INTEGER_FIELD
Constructor and Description |
---|
NumberDateFormat(DateFormat dateFormat)
Constructs a
NumberDateFormat object using the given DateFormat . |
Modifier and Type | Method and Description |
---|---|
StringBuffer |
format(double number,
StringBuffer toAppendTo,
FieldPosition pos) |
StringBuffer |
format(long number,
StringBuffer toAppendTo,
FieldPosition pos) |
StringBuffer |
format(Object number,
StringBuffer toAppendTo,
FieldPosition pos) |
Number |
parse(String source,
ParsePosition parsePosition) |
clone, equals, format, format, getAvailableLocales, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
format, formatToCharacterIterator, parseObject
public NumberDateFormat(DateFormat dateFormat)
NumberDateFormat
object using the given DateFormat
.dateFormat
- DateFormat
used to parse and format datespublic StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
format
in class NumberFormat
public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos)
format
in class NumberFormat
public Number parse(String source, ParsePosition parsePosition)
parse
in class NumberFormat
public StringBuffer format(Object number, StringBuffer toAppendTo, FieldPosition pos)
format
in class NumberFormat
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.