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

    ChoiceFormat(double[] limits, String[] formats)

    Constructs with the limits and the corresponding formats.

    Constructs a ChoiceFormat with limits and corresponding formats based on the pattern.

  • Method Summary

    void

    Apply the given pattern to this ChoiceFormat object.

    clone()

    boolean

    Compares the specified object with this ChoiceFormat for equality.

    Returns pattern with formatted double.

    Specialization of format.

    Returns the formats of this ChoiceFormat.

    double[]

    getLimits()

    Returns the limits of this ChoiceFormat.

    int

    hashCode()

    Returns the hash code for this ChoiceFormat.

    boolean

    isStrict()

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

    static final double

    nextDouble(double d)

    Finds the least double greater than d.

    static double

    nextDouble(double d, boolean positive)

    Finds the least double greater than d (if positive is true), or the greatest double less than d (if positive is false).

    Parses the input text starting at the index given by the ParsePosition as a Double.

    static final double

    previousDouble(double d)

    Finds the greatest double less than d.

    void

    setChoices(double[] limits, String[] formats)

    Set the choices to be used in formatting.

    void

    setStrict(boolean strict)

    Change the leniency value for parsing.

    toPattern()

    Returns a pattern string that represents the limits and formats of this ChoiceFormat object.

    toString()

    Returns a string identifying this ChoiceFormat, for debugging.

    Methods declared in class NumberFormat

    format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode

    Specialization of format.

    Specialization of format.

    Formats a number and appends the resulting text to the given string buffer.

    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.

    boolean

    Returns true if grouping is used in this format.

    boolean

    Returns true if this format will parse numbers as integers only.

    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.

    void

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

    void

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

    void

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

    void

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

    void

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

    void

    Sets whether or not numbers should be parsed as integers only.

    void

    Methods declared in class Format

    format, formatToCharacterIterator, parseObject

    Formats an object to produce a string.

    Formats an Object producing an AttributedCharacterIterator.

    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

    • ChoiceFormat

    • ChoiceFormat

  • Method Details

    • applyPattern

    • toPattern

    • setChoices

    • getLimits

    • getFormats

    • format

    • format

    • parse

    • isStrict

    • setStrict

    • nextDouble

    • nextDouble

    • previousDouble

    • clone

    • hashCode

    • toString

    • equals