API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.text. ChoiceFormat View Source
Author(s)
Mark Davis
Since
Version
1.22 09/21/98
Serial
Hierarchy
 Object
      Format
          NumberFormat
              ChoiceFormat
Implements
Subclasses
Description
public class ChoiceFormat
  A ChoiceFormat allows you to attach a format to a range of numbers.
See also:    DecimalFormat MessageFormat
Constructors
public ChoiceFormat (double[] limits, String formats)
  Constructs with the limits and the corresponding formats.
public ChoiceFormat (String newPattern)
  Constructs with limits and corresponding formats based on the pattern.
Methods
Hide/Show inherited methods
public void applyPattern (String newPattern)
  Sets the pattern.
public Object clone () [Overrides NumberFormat]
Overrides Cloneable
pack-private AttributedCharacterIterator createAttributedCharacterIterator (AttributedCharacterIterator iterators) [Inherited From Format]
  Creates an AttributedCharacterIterator containg the concatenated contents of the passed in AttributedCharacterIterators.
pack-private AttributedCharacterIterator createAttributedCharacterIterator (AttributedCharacterIterator iterator, Attribute key, Object value) [Inherited From Format]
  Creates an AttributedCharacterIterator with the contents of iterator and the additional attribute key value.
pack-private AttributedCharacterIterator createAttributedCharacterIterator (String s) [Inherited From Format]
  Creates an AttributedCharacterIterator for the String s.
pack-private AttributedCharacterIterator createAttributedCharacterIterator (String string, Attribute key, Object value) [Inherited From Format]
  Returns an AttributedCharacterIterator with the String string and additional key/value pair key, value.
public boolean equals (Object obj) [Overrides NumberFormat]
Equality comparision between two
publicfinal String format (double number) [Inherited From NumberFormat]
  Specialization of format.
public StringBuffer format (double number, StringBuffer toAppendTo, FieldPosition status) [Specified in NumberFormat]
  Returns pattern with formatted double.
publicfinal String format (long number) [Inherited From NumberFormat]
  Specialization of format.
public StringBuffer format (long number, StringBuffer toAppendTo, FieldPosition status) [Specified in NumberFormat]
  Specialization of format.
publicfinal String format (Object obj) [Inherited From Format]
  Formats an object to produce a string.
public StringBuffer format (Object number, StringBuffer toAppendTo, FieldPosition pos) [Inherited From NumberFormat] [Specified in Format]
  Formats a number and appends the resulting text to the given string buffer.
public AttributedCharacterIterator formatToCharacterIterator (Object obj) [Inherited From Format]
  Formats an Object producing an AttributedCharacterIterator.
publicstatic Locale getAvailableLocales () [Inherited From NumberFormat]
  Returns an array of all locales for which the get*Instance methods of this class can return localized instances.
public Currency getCurrency () [Inherited From NumberFormat]
  Gets the currency used by this number format when formatting currency values.
publicfinalstatic NumberFormat getCurrencyInstance () [Inherited From NumberFormat]
Returns a currency format for the current default locale.
publicstatic NumberFormat getCurrencyInstance (Locale inLocale) [Inherited From NumberFormat]
Returns a currency format for the specified locale.
public Object getFormats ()
  Get the formats passed in the constructor.
publicfinalstatic NumberFormat getInstance () [Inherited From NumberFormat]
  Returns a general-purpose number format for the current default locale.
publicstatic NumberFormat getInstance (Locale inLocale) [Inherited From NumberFormat]
  Returns a general-purpose number format for the specified locale.
publicfinalstatic NumberFormat getIntegerInstance () [Inherited From NumberFormat]
  Returns an integer number format for the current default locale.
publicstatic NumberFormat getIntegerInstance (Locale inLocale) [Inherited From NumberFormat]
  Returns an integer number format for the specified locale.
public double getLimits ()
  Get the limits passed in the constructor.
public int getMaximumFractionDigits () [Inherited From NumberFormat]
  Returns the maximum number of digits allowed in the fraction portion of a number.
public int getMaximumIntegerDigits () [Inherited From NumberFormat]
  Returns the maximum number of digits allowed in the integer portion of a number.
public int getMinimumFractionDigits () [Inherited From NumberFormat]
  Returns the minimum number of digits allowed in the fraction portion of a number.
public int getMinimumIntegerDigits () [Inherited From NumberFormat]
  Returns the minimum number of digits allowed in the integer portion of a number.
publicfinalstatic NumberFormat getNumberInstance () [Inherited From NumberFormat]
Returns a general-purpose number format for the current default locale.
publicstatic NumberFormat getNumberInstance (Locale inLocale) [Inherited From NumberFormat]
Returns a general-purpose number format for the specified locale.
publicfinalstatic NumberFormat getPercentInstance () [Inherited From NumberFormat]
Returns a percentage format for the current default locale.
publicstatic NumberFormat getPercentInstance (Locale inLocale) [Inherited From NumberFormat]
Returns a percentage format for the specified locale.
public RoundingMode getRoundingMode () [Inherited From NumberFormat]
  Gets the RoundingMode used in this NumberFormat.
pack-privatefinalstatic NumberFormat getScientificInstance () [Inherited From NumberFormat]
Returns a scientific format for the current default locale.
pack-privatestatic NumberFormat getScientificInstance (Locale inLocale) [Inherited From NumberFormat]
Returns a scientific format for the specified locale.
public int hashCode () [Overrides NumberFormat]
Generates a hash code for the message format object.
public boolean isGroupingUsed () [Inherited From NumberFormat]
  Returns true if grouping is used in this format.
public boolean isParseIntegerOnly () [Inherited From NumberFormat]
  Returns true if this format will parse numbers as integers only.
publicfinalstatic double nextDouble (double d)
  Finds the least double greater than d.
publicstatic double nextDouble (double d, boolean positive)
  Finds the least double greater than d (if positive == true), or the greatest double less than d (if positive == false).
public Number parse (String source) throws ParseException [Inherited From NumberFormat]
  Parses text from the beginning of the given string to produce a number.
public Number parse (String text, ParsePosition status) [Specified in NumberFormat]
  Parses a Number from the input text.
public Object parseObject (String source) throws ParseException [Inherited From Format]
  Parses text from the beginning of the given string to produce an object.
publicfinal Object parseObject (String source, ParsePosition pos) [Inherited From NumberFormat] [Specified in Format]
  Parses text from a string to produce a Number.
publicfinalstatic double previousDouble (double d)
  Finds the greatest double less than d.
public void setChoices (double[] limits, String formats)
  Set the choices to be used in formatting.
public void setCurrency (Currency currency) [Inherited From NumberFormat]
  Sets the currency used by this number format when formatting currency values.
public void setGroupingUsed (boolean newValue) [Inherited From NumberFormat]
  Set whether or not grouping will be used in this format.
public void setMaximumFractionDigits (int newValue) [Inherited From NumberFormat]
  Sets the maximum number of digits allowed in the fraction portion of a number.
public void setMaximumIntegerDigits (int newValue) [Inherited From NumberFormat]
  Sets the maximum number of digits allowed in the integer portion of a number.
public void setMinimumFractionDigits (int newValue) [Inherited From NumberFormat]
  Sets the minimum number of digits allowed in the fraction portion of a number.
public void setMinimumIntegerDigits (int newValue) [Inherited From NumberFormat]
  Sets the minimum number of digits allowed in the integer portion of a number.
public void setParseIntegerOnly (boolean value) [Inherited From NumberFormat]
  Sets whether or not numbers should be parsed as integers only.
public void setRoundingMode (RoundingMode roundingMode) [Inherited From NumberFormat]
  Sets the RoundingMode used in this NumberFormat.
public String toPattern ()
Gets the pattern.
Fields
Hide/Show inherited fields
pack-privatefinalstatic int currentSerialVersion = "1" [Inherited From NumberFormat]
pack-privatefinalstatic long EXPONENT = "9218868437227405312"
publicfinalstatic int FRACTION_FIELD = "1" [Inherited From NumberFormat]
  Field constant used to construct a FieldPosition object.
publicfinalstatic int INTEGER_FIELD = "0" [Inherited From NumberFormat]
  Field constant used to construct a FieldPosition object.
pack-privatefinalstatic long POSITIVEINFINITY = "9218868437227405312"
pack-privatefinalstatic long serialVersionUID = "-2308460125733713944" [Inherited From NumberFormat]
pack-privatefinalstatic long SIGN = "-9223372036854775808"
Nested Classes
  NumberFormat.Field
Defines constants that are used as attribute keys in the AttributedCharacterIterator returned from NumberFormat.formatToCharacterIterator and as field identifiers in FieldPosition.
  Format.Field
Defines constants that are used as attribute keys in the AttributedCharacterIterator returned from Format.formatToCharacterIterator and as field identifiers in FieldPosition.
  Format.FieldDelegate
FieldDelegate is notified by the various Format implementations as they are formatting the Objects.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar