All Implemented Interfaces:
Serializable, Cloneable

  • Nested Class Summary

    Nested classes/interfaces declared in class NumberFormat

    NumberFormat.Field, NumberFormat.Style

    static class 

    Defines constants that are used as attribute keys in the AttributedCharacterIterator returned from NumberFormat.formatToCharacterIterator and as field identifiers in FieldPosition.

    static enum 

  • Field Summary

    Fields declared in class NumberFormat

    FRACTION_FIELD, INTEGER_FIELD

    static final int

    Field constant used to construct a FieldPosition object.

    static final int

    Field constant used to construct a FieldPosition object.

  • Constructor Summary

    Constructors

    Creates a CompactNumberFormat using the given decimal pattern, decimal format symbols and compact patterns.

    Creates a CompactNumberFormat using the given decimal pattern, decimal format symbols, compact patterns, and plural rules.

  • Method Summary

    clone()

    Creates and returns a copy of this CompactNumberFormat instance.

    boolean

    Compares the specified object with this CompactNumberFormat for equality.

    Formats a double to produce a string representing its compact form.

    Formats a long to produce a string representing its compact form.

    Formats a number to produce a string representing its compact form.

    Formats an Object producing an AttributedCharacterIterator.

    int

    Returns the grouping size.

    int

    hashCode()

    Returns the hash code for this CompactNumberFormat.

    boolean

    Returns true if grouping is used in this format.

    boolean

    Returns whether the parse(String, ParsePosition) method returns BigDecimal.

    boolean

    Returns true if this format parses only an integer from the number component of a compact number.

    boolean

    isStrict()

    Returns true if this format will parse numbers strictly; false otherwise.

    Parses text from the beginning of the given string to produce a Number.

    void

    setGroupingSize(int newValue)

    void

    setGroupingUsed(boolean newValue)

    Sets whether or not grouping will be used in this format.

    void

    setMaximumFractionDigits(int newValue)

    Sets the maximum number of digits allowed in the fraction portion of a number during formatting.

    void

    setMaximumIntegerDigits(int newValue)

    Sets the maximum number of digits allowed in the integer portion of a number during formatting.

    void

    setMinimumFractionDigits(int newValue)

    Sets the minimum number of digits allowed in the fraction portion of a number during formatting.

    void

    setMinimumIntegerDigits(int newValue)

    Sets the minimum number of digits allowed in the integer portion of a number during formatting.

    void

    setParseBigDecimal(boolean newValue)

    Sets whether the parse(String, ParsePosition) method returns BigDecimal.

    void

    setParseIntegerOnly(boolean value)

    Sets whether or not this format parses only an integer from the number component of a compact number.

    void

    void

    setStrict(boolean strict)

    Change the leniency value for parsing.

    toString()

    Returns a string identifying this CompactNumberFormat, for debugging.

    Methods declared in class NumberFormat

    format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, parse, parseObject, setCurrency

    Specialization of format.

    Specialization of format.

    Returns an array of all locales for which the get*Instance methods of this class can return localized instances.

    Returns a compact number format for the default FORMAT locale with "SHORT" format style.

    Gets the currency used by this number format when formatting currency values.

    Returns a currency format for the current default FORMAT locale.

    Returns a currency format for the specified locale.

    Returns a general-purpose number format for the current default FORMAT locale.

    Returns a general-purpose number format for the specified locale.

    Returns an integer number format for the current default FORMAT locale.

    Returns an integer number format for the specified locale.

    int

    Returns the maximum number of digits allowed in the fraction portion of a number during formatting.

    int

    Returns the maximum number of digits allowed in the integer portion of a number during formatting.

    int

    Returns the minimum number of digits allowed in the fraction portion of a number during formatting.

    int

    Returns the minimum number of digits allowed in the integer portion of a number during formatting.

    Returns a general-purpose number format for the current default FORMAT locale.

    Returns a general-purpose number format for the specified locale.

    Returns a percentage format for the current default FORMAT locale.

    Returns a percentage format for the specified locale.

    Parses text from the beginning of the given string to produce a Number.

    Parses text from the given string to produce an object.

    void

    Sets the currency used by this number format when formatting currency values.

    Methods declared in class Format

    format, parseObject

    Formats an object to produce a string.

    Parses text from the beginning of the given string to produce an object.

    Methods declared in class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    protected void

    Deprecated, for removal: This API element is subject to removal in a future version.

    Returns the runtime class of this Object.

    final void

    Wakes up a single thread that is waiting on this object's monitor.

    final void

    Wakes up all threads that are waiting on this object's monitor.

    final void

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

    final void

    wait(long timeoutMillis)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

    final void

    wait(long timeoutMillis, int nanos)

    Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

  • Constructor Details

    • CompactNumberFormat

    • CompactNumberFormat

  • Method Details

    • format

    • format

    • format

    • formatToCharacterIterator

    • parse

    • setMaximumIntegerDigits

    • setMinimumIntegerDigits

    • setMinimumFractionDigits

    • setMaximumFractionDigits

    • getRoundingMode

    • setRoundingMode

    • getGroupingSize

    • setGroupingSize

    • isGroupingUsed

    • setGroupingUsed

    • isParseIntegerOnly

    • setParseIntegerOnly

    • isStrict

    • setStrict

    • isParseBigDecimal

    • setParseBigDecimal

    • equals

    • hashCode

    • toString

    • clone