API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.text. MessageFormat View Source
Author(s)
Mark Davis
Since
Version
1.62, 04/07/06
Serial
Hierarchy
 Object
      Format
          MessageFormat
Implements
Subclasses
Description
public class MessageFormat
  MessageFormat provides a means to produce concatenated messages in a language-neutral way.
Constructors
public MessageFormat (String pattern)
  Constructs a MessageFormat for the default locale and the specified pattern.
public MessageFormat (String pattern, Locale locale)
  Constructs a MessageFormat for the specified locale and pattern.
Methods
Hide/Show inherited methods
public void applyPattern (String pattern)
  Sets the pattern used by this message format.
public Object clone () [Overrides Format]
  Creates and returns a copy of this object.
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)
Equality comparison between two message format objects
publicfinal String format (Object obj) [Inherited From Format]
  Formats an object to produce a string.
publicfinal StringBuffer format (Object arguments, StringBuffer result, FieldPosition pos)
  Formats an array of objects and appends the MessageFormat's pattern, with format elements replaced by the formatted objects, to the provided StringBuffer.
publicfinal StringBuffer format (Object arguments, StringBuffer result, FieldPosition pos) [Specified in Format]
  Formats an array of objects and appends the MessageFormat's pattern, with format elements replaced by the formatted objects, to the provided StringBuffer.
publicstatic String format (String pattern, Object arguments)
  Creates a MessageFormat with the given pattern and uses it to format the given arguments.
public AttributedCharacterIterator formatToCharacterIterator (Object arguments) [Overrides Format]
  Formats an array of objects and inserts them into the MessageFormat's pattern, producing an AttributedCharacterIterator.
public Format getFormats ()
  Gets the formats used for the format elements in the previously set pattern string.
public Format getFormatsByArgumentIndex ()
  Gets the formats used for the values passed into format methods or returned from parse methods.
public Locale getLocale ()
  Gets the locale that's used when creating or comparing subformats.
public int hashCode ()
Generates a hash code for the message format object.
public Object parse (String source) throws ParseException
  Parses text from the beginning of the given string to produce an object array.
public Object parse (String source, ParsePosition pos)
  Parses the string.
public Object parseObject (String source) throws ParseException [Inherited From Format]
  Parses text from the beginning of the given string to produce an object.
public Object parseObject (String source, ParsePosition pos) [Specified in Format]
  Parses text from a string to produce an object array.
public void setFormat (int formatElementIndex, Format newFormat)
  Sets the format to use for the format element with the given format element index within the previously set pattern string.
public void setFormatByArgumentIndex (int argumentIndex, Format newFormat)
  Sets the format to use for the format elements within the previously set pattern string that use the given argument index.
public void setFormats (Format newFormats)
  Sets the formats to use for the format elements in the previously set pattern string.
public void setFormatsByArgumentIndex (Format newFormats)
  Sets the formats to use for the values passed into format methods or returned from parse methods.
public void setLocale (Locale locale)
  Sets the locale to be used when creating or comparing subformats.
public String toPattern ()
  Returns a pattern representing the current state of the message format.
Fields
Hide/Show inherited fields
Nested Classes
  MessageFormat.Field
Defines constants that are used as attribute keys in the AttributedCharacterIterator returned from MessageFormat.formatToCharacterIterator.
  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