[loc-en-dev] MessageFormat question

Mark Davis ☕ mark at macchiato.com
Tue Aug 9 07:00:30 PDT 2011


I don't remember what the implementation ended up as, but we carried the
original intent over from the Taligent code, which was to allow alignment to
different fields as I described.

Mark
*— Il meglio è l’inimico del bene —*


On Mon, Aug 8, 2011 at 22:05, Masayoshi Okutsu
<masayoshi.okutsu at oracle.com>wrote:

> **
> Thanks. But the implementation seems to be different. (I'm talking about
> JDK, not ICU4J.) MessageFormat.format takes only
> MessageFormat.Field.ARGUMENT. Specifying
> NumberFormat.Field.DECIMAL_SEPARATOR has no effect.
>
> FieldPosition had been added to JDK in 1.1 before Format.Field support was
> added in 1.4 for Swing. I wondered what the original intention of the spec
> was, especially with a FieldPosition constructed with FieldPosition(int).
> The other two constructors were added in 1.4.
>
> Masayoshi
>
>
> On 8/9/2011 9:50 AM, Mark Davis ☕ wrote:
>
> It is for lining up columns.
>
>  For example, suppose you have a column in a spreadsheet with formatted
> numbers. If you pass in
> http://download.oracle.com/javase/6/docs/api/java/text/NumberFormat.Field.html#DECIMAL_SEPARATORyou can find out the start/end position of the decimal separator, no matter
> what language the numbers are formatted in, and align them. In practice,
> that one field is probably the only really useful one.
>
>  Mark
> *— Il meglio è l’inimico del bene —*
>
>
> On Mon, Aug 8, 2011 at 01:40, Masayoshi Okutsu <
> masayoshi.okutsu at oracle.com> wrote:
>
>> I wonder if someone on this mailing list has some idea on my question
>> below.
>>
>> MessageFormat.format takes a FieldPosition defined as follows:
>>
>> pos - On input: an alignment field, if desired. On output: the offsets of
>> the alignment field.
>>
>> What's the intention of this spec? What's the alignment field?
>>
>> Thanks in advance,
>>  Masayoshi
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/locale-enhancement-dev/attachments/20110809/2023c06b/attachment.html 


More information about the locale-enhancement-dev mailing list