public final class DateNumberFormat extends NumberFormat
NumberFormat.Field, NumberFormat.NumberFormatFactory, NumberFormat.SimpleNumberFormatFactoryUFormat.SpanFieldACCOUNTINGCURRENCYSTYLE, CASHCURRENCYSTYLE, CURRENCYSTYLE, FRACTION_FIELD, INTEGER_FIELD, INTEGERSTYLE, ISOCURRENCYSTYLE, NUMBERSTYLE, PERCENTSTYLE, PLURALCURRENCYSTYLE, SCIENTIFICSTYLE, STANDARDCURRENCYSTYLE| Constructor and Description |
|---|
DateNumberFormat(ULocale loc,
char zeroDigit,
String nsName) |
DateNumberFormat(ULocale loc,
String digitString,
String nsName) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Overrides clone.
|
boolean |
equals(Object obj)
Overrides equals.
|
StringBuffer |
format(BigDecimal number,
StringBuffer toAppendTo,
FieldPosition pos)
Formats a BigDecimal.
|
StringBuffer |
format(BigDecimal number,
StringBuffer toAppendTo,
FieldPosition pos)
Formats an ICU BigDecimal.
|
StringBuffer |
format(BigInteger number,
StringBuffer toAppendTo,
FieldPosition pos)
Formats a BigInteger.
|
StringBuffer |
format(double number,
StringBuffer toAppendTo,
FieldPosition pos)
Specialization of format.
|
StringBuffer |
format(long numberL,
StringBuffer toAppendTo,
FieldPosition pos)
Specialization of format.
|
char[] |
getDigits() |
int |
getMaximumIntegerDigits()
Returns the maximum number of digits allowed in the integer portion of a
number.
|
int |
getMinimumIntegerDigits()
Returns the minimum number of digits allowed in the integer portion of a
number.
|
char |
getZeroDigit() |
int |
hashCode() |
Number |
parse(String text,
ParsePosition parsePosition)
Returns a Long if possible (e.g., within the range [Long.MIN_VALUE,
Long.MAX_VALUE] and with no decimals); otherwise, returns another type,
such as a BigDecimal, BigInteger, or Double.
|
void |
setMaximumIntegerDigits(int newValue)
Sets the maximum number of digits allowed in the integer portion of a
number.
|
void |
setMinimumIntegerDigits(int newValue)
Sets the minimum number of digits allowed in the integer portion of a
number.
|
void |
setParsePositiveOnly(boolean isPositiveOnly) |
void |
setZeroDigit(char zero) |
format, format, format, format, format, format, format, format, getAvailableLocales, getAvailableULocales, getContext, getCurrency, getCurrencyInstance, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMinimumFractionDigits, getNumberInstance, getNumberInstance, getNumberInstance, getPattern, getPercentInstance, getPercentInstance, getPercentInstance, getRoundingMode, getScientificInstance, getScientificInstance, getScientificInstance, isGroupingUsed, isParseIntegerOnly, isParseStrict, parse, parseCurrency, parseObject, registerFactory, setContext, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMinimumFractionDigits, setParseIntegerOnly, setParseStrict, setRoundingMode, unregisterformat, formatToCharacterIterator, parseObjectpublic void setMaximumIntegerDigits(int newValue)
NumberFormatsetMaximumIntegerDigits in class NumberFormatnewValue - the maximum number of integer digits to be shown; if
less than zero, then zero is used. Subclasses might enforce an
upper limit to this value appropriate to the numeric type being formatted.NumberFormat.getMaximumIntegerDigits()public int getMaximumIntegerDigits()
NumberFormatgetMaximumIntegerDigits in class NumberFormatNumberFormat.setMaximumIntegerDigits(int)public void setMinimumIntegerDigits(int newValue)
NumberFormatsetMinimumIntegerDigits in class NumberFormatnewValue - the minimum number of integer digits to be shown; if
less than zero, then zero is used. Subclasses might enforce an
upper limit to this value appropriate to the numeric type being formatted.NumberFormat.getMinimumIntegerDigits()public int getMinimumIntegerDigits()
NumberFormatgetMinimumIntegerDigits in class NumberFormatNumberFormat.setMinimumIntegerDigits(int)public void setParsePositiveOnly(boolean isPositiveOnly)
public char getZeroDigit()
public void setZeroDigit(char zero)
public char[] getDigits()
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
NumberFormatformat in class NumberFormatFormat.format(Object, StringBuffer, FieldPosition)public StringBuffer format(long numberL, StringBuffer toAppendTo, FieldPosition pos)
NumberFormatformat in class NumberFormatFormat.format(Object, StringBuffer, FieldPosition)public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos)
NumberFormatformat in class NumberFormatFormat.format(Object, StringBuffer, FieldPosition)public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)
NumberFormatformat in class NumberFormatFormat.format(Object, StringBuffer, FieldPosition)public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)
NumberFormatformat in class NumberFormatFormat.format(Object, StringBuffer, FieldPosition)public Number parse(String text, ParsePosition parsePosition)
NumberFormatIf IntegerOnly is set, will stop at a decimal point (or equivalent; e.g., for rational numbers "1 2/3", will stop after the 1).
Does not throw an exception; if no object can be parsed, index is unchanged!
For more detail on parsing, see the "Parsing" header in the class
documentation of DecimalFormat.
parse in class NumberFormatNumberFormat.isParseIntegerOnly(),
DecimalFormat.setParseBigDecimal(boolean),
Format.parseObject(String, ParsePosition)public boolean equals(Object obj)
NumberFormatequals in class NumberFormatobj - the object to compare againstpublic int hashCode()
NumberFormathashCode in class NumberFormatpublic Object clone()
NumberFormatclone in class NumberFormat