Package org.apache.sis.internal.util
Class AutoMessageFormat
java.lang.Object
java.text.Format
java.text.MessageFormat
org.apache.sis.internal.util.AutoMessageFormat
- All Implemented Interfaces:
Serializable,Cloneable
A message format which adjust automatically the number of fraction digits needed for formatting numbers.
Callers need to invoke
configure(Object[]) before to invoke any format(…) method.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Martin Desruisseaux (Geomatys)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.MessageFormat
MessageFormat.Field -
Constructor Summary
ConstructorsConstructorDescriptionAutoMessageFormat(String pattern) Creates a new message for the default locale.AutoMessageFormat(String pattern, Locale locale) Creates a new message for the given locale. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPattern(String pattern) Modifies the pattern used by this message format.voidConfigures the number of fraction digits in the formats used by thisMessageFormat.Methods inherited from class java.text.MessageFormat
clone, equals, format, format, format, formatToCharacterIterator, getFormats, getFormatsByArgumentIndex, getLocale, hashCode, parse, parse, parseObject, setFormat, setFormatByArgumentIndex, setFormats, setFormatsByArgumentIndex, setLocale, toPatternMethods inherited from class java.text.Format
format, parseObject
-
Constructor Details
-
AutoMessageFormat
Creates a new message for the default locale.- Parameters:
pattern- the pattern for this message format.
-
AutoMessageFormat
Creates a new message for the given locale.- Parameters:
pattern- the pattern for this message format.locale- the locale for this message format.
-
-
Method Details
-
applyPattern
Modifies the pattern used by this message format.- Overrides:
applyPatternin classMessageFormat- Parameters:
pattern- the new pattern for this message format
-
configure
Configures the number of fraction digits in the formats used by thisMessageFormat. This method can work only for parameters declared as"{#,number}"in the message pattern.- Parameters:
arguments- the argument to be given toFormat.format(Object).
-