You must fill out this code:
ArrayList<ArrayList<DriverLogDatePair>> driverLogList = new ArrayList<>(); Collections.sort( driverLogList, new Comparator<ArrayList<DriverLogDatePair>>(){ @Override public int compare( ArrayList<DriverLogDatePair> left, ArrayList<DriverLogDatePair> right ) { return 0; }});
Since the first array contains an array that contains Comparable. The comparator you provide is for DriverLogDatePair not for ArrayList <DriverLogDatePair>
(... after the comments of this post ...)
At your request, to complete the comparator, I suggest:
int size = left.size(); int diff = size - right.size(); if( diff != 0 ) return diff; for( int i = 0; i < size; ++i ) { diff = left.get( i ).compareTo( right.get(i) ); if( diff != 0 ) return diff; }
But I have no idea about the true meaning of this comparison. This is a semantic problem, is it really what you want?
source share