MessageFormat (Java SE 26 & JDK 26)
- All Implemented Interfaces:
Serializable, Cloneable
-
Nested Class Summary
Nested Classes
static classDefines constants that are used as attribute keys in the
AttributedCharacterIteratorreturned fromMessageFormat.formatToCharacterIterator. -
Constructor Summary
Constructors
Constructs a MessageFormat for the default
FORMATlocale and the specified pattern.Constructs a MessageFormat for the specified locale and pattern.
-
Method Summary
voidSets the pattern used by this message format.
clone()Creates and returns a copy of this object.
booleanCompares the specified object with this
MessageFormatfor equality.Formats an array of objects and appends the
MessageFormat's pattern, with format elements replaced by the formatted objects, to the providedStringBuffer.Formats an array of objects and appends the
MessageFormat's pattern, with format elements replaced by the formatted objects, to the providedStringBuffer.Creates a MessageFormat with the given pattern and uses it to format the given arguments.
Formats an array of objects and inserts them into the
MessageFormat's pattern, producing anAttributedCharacterIterator.Gets the formats used for the format elements in the previously set pattern string.
Gets the formats used for the values passed into
formatmethods or returned fromparsemethods.Gets the locale that's used when creating or comparing subformats.
inthashCode()Returns the hash code value for this
MessageFormat.Parses text from the beginning of the given string to produce an object array.
Parses text from a string to produce an object array.
voidsetFormat(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.
voidsetFormatByArgumentIndex(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.
voidSets the formats to use for the format elements in the previously set pattern string.
voidSets the formats to use for the values passed into
formatmethods or returned fromparsemethods.voidSets the locale to be used when creating or comparing subformats.
Returns a String pattern adhering to the
patterns sectionthat represents the current state of thisMessageFormat.toString()Returns a string identifying this
MessageFormat, for debugging.Methods declared in class Format
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, waitprotected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(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 voidwait(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
-
MessageFormat
-
MessageFormat
-
-
Method Details
-
setLocale
-
getLocale
-
applyPattern
-
toPattern
-
setFormatsByArgumentIndex
-
setFormats
-
setFormatByArgumentIndex
-
setFormat
-
getFormatsByArgumentIndex
-
getFormats
-
format
-
format
-
format
-
formatToCharacterIterator
-
parse
-
parse
-
parseObject
-
clone
-
equals
-
hashCode
-
toString
-