commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <>
Subject Re: FormattableUtils
Date Wed, 04 May 2011 13:33:34 GMT
On May 4, 2011, at 9:02, Stephen Colebourne <> wrote:

> On 4 May 2011 13:47, Matt Benson <> wrote:
>> At some point Hen mentioned the idea of a PairFormat class.  I don't
>> think this is a bad idea, but the parsing capabilities of such a beast
>> would be minimal to nonexistent, and it still doesn't seem that it
>> would be configurable in a simple way without doing the equivalent of
>> String.format("", left, right).  At this point I am still not sure
>> what is the right mechanism for providing custom string
>> representations of Pair in the simplest and most elegant possible way.
>>  Have any ideas?

Nothing small and simple. Adding formatting to a pair smells like
mixing a view in a model.

Cleanly separating model and view leads to code that starts to feel
outside the scope of lang. Unless we started to need to format pairs
all over the place.

Btw, isn't a range a pair?

> Not really.
> toString(format) does the job of custom formatting pretty well.
> Anything else is a wrapper around that which feels pretty unecessary.
> Thus, I'd like to make Pair no longer implement Formattable (BTW, I
> don't think anything in the JDK implements Formattable, so its a weird
> interface).
> Stephen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message