Top Fields Constructors Methods
com.ibm.icu.impl

public final Class DateNumberFormat

extends NumberFormat
Class Inheritance
Imports
java.io.IOException, .ObjectInputStream, java.math.BigInteger, java.text.FieldPosition, .ParsePosition, java.util.Arrays, .MissingResourceException, com.ibm.icu.lang.UCharacter, com.ibm.icu.math.BigDecimal, com.ibm.icu.text.NumberFormat, com.ibm.icu.util.ULocale, .UResourceBundle

Field Summary

Modifier and TypeField and Description
private static SimpleCache<ULocale, char[]>
private static final int
private transient char[]
private char[]
private int
private int
private char
private static final long
private boolean
private static final long
private char
Inherited from com.ibm.icu.text.NumberFormat:
ACCOUNTINGCURRENCYSTYLECASHCURRENCYSTYLECURRENCYSTYLEFRACTION_FIELDINTEGER_FIELDINTEGERSTYLEISOCURRENCYSTYLENUMBERSTYLEPERCENTSTYLEPLURALCURRENCYSTYLESCIENTIFICSTYLESTANDARDCURRENCYSTYLE

Constructor Summary

AccessConstructor and Description
public
DateNumberFormat(ULocale loc, String digitString, String nsName)

public
DateNumberFormat(ULocale loc, char zeroDigit, String nsName)

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides com.ibm.icu.text.NumberFormat.clone.

Overrides clone.
public boolean
equals(Object
the object to compare against
obj
)

Overrides com.ibm.icu.text.NumberFormat.equals.

Overrides equals.
public StringBuffer
format(double number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Specialization of format.
public StringBuffer
format(long numberL, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Specialization of format.
public StringBuffer
format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

ICU

public StringBuffer
format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

ICU

public StringBuffer
format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

ICU

public char[]
public int
getMaximumIntegerDigits()

Overrides com.ibm.icu.text.NumberFormat.getMaximumIntegerDigits.

Returns the maximum number of digits allowed in the integer portion of a number.
public int
getMinimumIntegerDigits()

Overrides com.ibm.icu.text.NumberFormat.getMinimumIntegerDigits.

Returns the minimum number of digits allowed in the integer portion of a number.
public char
public int
hashCode()

Overrides com.ibm.icu.text.NumberFormat.hashCode.

Returns a hash code value for the object.
private void
initialize(ULocale loc, String digitString, String nsName)

public Number
parse(String text, ParsePosition parsePosition)

Implements abstract com.ibm.icu.text.NumberFormat.parse.

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.
private void
readObject(ObjectInputStream stream)

Hides com.ibm.icu.text.NumberFormat.readObject.

First, read in the default serializable data.
public void
setMaximumIntegerDigits(int
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.
newValue
)

Overrides com.ibm.icu.text.NumberFormat.setMaximumIntegerDigits.

Sets the maximum number of digits allowed in the integer portion of a number.
public void
setMinimumIntegerDigits(int
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.
newValue
)

Overrides com.ibm.icu.text.NumberFormat.setMinimumIntegerDigits.

Sets the minimum number of digits allowed in the integer portion of a number.
public void
setParsePositiveOnly(boolean isPositiveOnly)

public void
setZeroDigit(char zero)

Inherited from com.ibm.icu.text.NumberFormat:
formatformatformatformatformatformatformatformatgetAvailableLocalesgetAvailableULocalesgetContextgetCurrencygetCurrencyInstancegetCurrencyInstancegetCurrencyInstancegetEffectiveCurrencygetInstancegetInstancegetInstancegetInstancegetInstancegetInstancegetIntegerInstancegetIntegerInstancegetIntegerInstancegetMaximumFractionDigitsgetMinimumFractionDigitsgetNumberInstancegetNumberInstancegetNumberInstancegetPatterngetPatterngetPatternForStylegetPatternForStyleAndNumberingSystemgetPercentInstancegetPercentInstancegetPercentInstancegetRoundingModegetScientificInstancegetScientificInstancegetScientificInstanceisGroupingUsedisParseIntegerOnlyisParseStrictparseparseCurrencyparseObjectregisterFactorysetContextsetCurrencysetGroupingUsedsetMaximumFractionDigitssetMinimumFractionDigitssetParseIntegerOnlysetParseStrictsetRoundingModeunregister

Field Detail

CACHEback to summary
private static SimpleCache<ULocale, char[]> CACHE
DECIMAL_BUF_SIZEback to summary
private static final int DECIMAL_BUF_SIZE
decimalBufback to summary
private transient char[] decimalBuf
digitsback to summary
private char[] digits
maxIntDigitsback to summary
private int maxIntDigits
minIntDigitsback to summary
private int minIntDigits
minusSignback to summary
private char minusSign
PARSE_THRESHOLDback to summary
private static final long PARSE_THRESHOLD
positiveOnlyback to summary
private boolean positiveOnly
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.ibm.icu.text.NumberFormat.serialVersionUID.

zeroDigitback to summary
private char zeroDigit

Constructor Detail

DateNumberFormatback to summary
public DateNumberFormat(ULocale loc, String digitString, String nsName)
DateNumberFormatback to summary
public DateNumberFormat(ULocale loc, char zeroDigit, String nsName)

Method Detail

cloneback to summary
public Object clone()

Overrides com.ibm.icu.text.NumberFormat.clone.

Doc from com.ibm.icu.text.NumberFormat.clone.

Overrides clone.

Returns:Object

Doc from java.text.Format.clone.

a clone of this instance.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides com.ibm.icu.text.NumberFormat.equals.

Doc from com.ibm.icu.text.NumberFormat.equals.

Overrides equals. Two NumberFormats are equal they are of the same class and the user-specified values for settings (groupingUsed, parseIntegerOnly, maximumIntegerDigits, etc.) are equal.

Parameters
obj:Object

the object to compare against

Returns:boolean

true if the object is equal to this.

Annotations
@Override
formatback to summary
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Doc from com.ibm.icu.text.NumberFormat.format.

Specialization of format.

Annotations
@Override
formatback to summary
public StringBuffer format(long numberL, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Doc from com.ibm.icu.text.NumberFormat.format.

Specialization of format.

Annotations
@Override
formatback to summary
public StringBuffer format(BigInteger number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Doc from com.ibm.icu.text.NumberFormat.format.

ICU

Formats a BigInteger. Specialization of format.
Annotations
@Override
formatback to summary
public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Doc from com.ibm.icu.text.NumberFormat.format.

ICU

Formats a BigDecimal. Specialization of format.
Annotations
@Override
formatback to summary
public StringBuffer format(BigDecimal number, StringBuffer toAppendTo, FieldPosition pos)

Implements abstract com.ibm.icu.text.NumberFormat.format.

Doc from com.ibm.icu.text.NumberFormat.format.

ICU

Formats an ICU BigDecimal. Specialization of format.
Annotations
@Override
getDigitsback to summary
public char[] getDigits()
getMaximumIntegerDigitsback to summary
public int getMaximumIntegerDigits()

Overrides com.ibm.icu.text.NumberFormat.getMaximumIntegerDigits.

Doc from com.ibm.icu.text.NumberFormat.getMaximumIntegerDigits.

Returns the maximum number of digits allowed in the integer portion of a number. The default value is 40, which subclasses can override. When formatting, if the number of digits exceeds this value, the highest- significance digits are truncated until the limit is reached, in accordance with UTS#35. This setting has no effect on parsing.

Returns:int

the maximum number of integer digits

Annotations
@Override
getMinimumIntegerDigitsback to summary
public int getMinimumIntegerDigits()

Overrides com.ibm.icu.text.NumberFormat.getMinimumIntegerDigits.

Doc from com.ibm.icu.text.NumberFormat.getMinimumIntegerDigits.

Returns the minimum number of digits allowed in the integer portion of a number. The default value is 1, which subclasses can override. When formatting, if this value is not reached, numbers are padded on the left with the locale-specific '0' character to ensure at least this number of integer digits. When parsing, this has no effect.

Returns:int

the minimum number of integer digits

Annotations
@Override
getZeroDigitback to summary
public char getZeroDigit()
hashCodeback to summary
public int hashCode()

Overrides com.ibm.icu.text.NumberFormat.hashCode.

Doc from com.ibm.icu.text.NumberFormat.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
initializeback to summary
private void initialize(ULocale loc, String digitString, String nsName)
parseback to summary
public Number parse(String text, ParsePosition parsePosition)

Implements abstract com.ibm.icu.text.NumberFormat.parse.

Doc from com.ibm.icu.text.NumberFormat.parse.

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. The return type is not guaranteed other than for the Long case.

If 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.

Annotations
@Override
readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Hides com.ibm.icu.text.NumberFormat.readObject.

Doc from com.ibm.icu.text.NumberFormat.readObject.

First, read in the default serializable data. Then, if serialVersionOnStream is less than 1, indicating that the stream was written by JDK 1.1, set the int fields such as maximumIntegerDigits to be equal to the byte fields such as maxIntegerDigits, since the int fields were not present in JDK 1.1. Finally, set serialVersionOnStream back to the maximum allowed value so that default serialization will work properly if this object is streamed out again.

setMaximumIntegerDigitsback to summary
public void setMaximumIntegerDigits(int newValue)

Overrides com.ibm.icu.text.NumberFormat.setMaximumIntegerDigits.

Doc from com.ibm.icu.text.NumberFormat.setMaximumIntegerDigits.

Sets the maximum number of digits allowed in the integer portion of a number. This must be >= minimumIntegerDigits. If the new value for maximumIntegerDigits is less than the current value of minimumIntegerDigits, then minimumIntegerDigits will also be set to the new value.

Parameters
newValue:int

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.

Annotations
@Override
setMinimumIntegerDigitsback to summary
public void setMinimumIntegerDigits(int newValue)

Overrides com.ibm.icu.text.NumberFormat.setMinimumIntegerDigits.

Doc from com.ibm.icu.text.NumberFormat.setMinimumIntegerDigits.

Sets the minimum number of digits allowed in the integer portion of a number. This must be <= maximumIntegerDigits. If the new value for minimumIntegerDigits is more than the current value of maximumIntegerDigits, then maximumIntegerDigits will also be set to the new value.

Parameters
newValue:int

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.

Annotations
@Override
setParsePositiveOnlyback to summary
public void setParsePositiveOnly(boolean isPositiveOnly)
setZeroDigitback to summary
public void setZeroDigit(char zero)