I have list of Joda-Time Interval objects.
List intervals = new ArrayList();
How can I sort the intervals o
Just create a Comparator which compares by start times:
public class IntervalStartComparator implements Comparator {
@Override
public int compare(Interval x, Interval y) {
return x.getStart().compareTo(y.getStart());
}
}
Then sort using that:
Collections.sort(intervals, new IntervalStartComparator());