Oh yes, the idea with the enum is nice. Thank you! I have saw the enum in Java 8, but I can’t use it, because we work now only with Java 6.
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 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
_______________________________________________ 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
|