Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] Sorter for Collection

If the days of week isn’t an enum yet, I’d create one for it and sort by their ordinal numbers. However, please note  that:

2. Some Locale would sort Sundays before Mondays.


HTH,
Marcel

Am 06.09.2014 um 12:51 schrieb gsoc <akif8877@xxxxxxxxx>:

Hello,

what’s the best way to build a sorter for a collection.

I have this requirement:

List with some Strings, which I want to sort:
List<String> dayList = ImmutableList.of(„Tue“, „Thu“, „Fri“, „Mon“, „Wed“);

I want to sort the days in this order: Mon, Tue, Wed, Thu, Fri not alphabetical.

Regards,
Akif
_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/recommenders-dev


Back to the top