On 02/08/2013 12:12 PM, Stephen Colebourne wrote:
On 8 February 2013 00:23, Remi Forax <fo...@univ-mlv.fr> wrote:
I wonder if it's not better to declare enum constants of DayOfWeek (and
Month) in an order that is not the usual week/month order to make clear that
ordinal() doesn't work as expected.
By example they can be declared in alphabetical order.
The constants need to be in order as Enums are Comparable.
(It was actually a mistake that all enums are Comparable, but not one
that can be fixed now)
don't get it,
English calendar starts with Sunday, French one with Monday,
so the result of Sunday.compareTo(Monday) is dubious,
that why I think that the only valid order is the lexical one.
Stephen
Rémi