If you can't just store the dates as Date objects, you need to define a custom comparator (that will end up implicitly converting the Strings to Date objects, so you really may as well just store them as dates). You can define both of these as fields in your class:
private final static String dateFormat = "EEE MMM dd HH:mm:ss yyyy";
private final static Comparator<String> dateComp = new Comparator<String>() {
public int compare(String s1, String s2) {
Date d1 = null;
try {
d1 = new SimpleDateFormat( dateFormat,Locale.ENGLISH ).parse(s1);
} catch (ParseException e) {
//HANDLE THIS EXCEPTION
}
Date d2 = null;
try {
d2 = new SimpleDateFormat( dateFormat,Locale.ENGLISH ).parse(s2);
} catch (ParseException e) {
//HANDLE THIS EXCEPTION
}
return d1.compareTo(d2);
}
};
Of course, you will have to effectively handle the required try/catch blocks and potential parsing exceptions. Additionally, you will have be to certain that is the format of your incoming date strings.
Here is an example using the above comparator:
String[] dateArray = new String[] {"Sat Dec 27 23:00:00 2014","Fri Dec 26 23:00:00 2014","Sun Dec 28 23:00:00 2014"};
List<String> dateList = new ArrayList<String>(Arrays.asList(dateArray));
Collections.sort(dateList, dateComp);
Prints:
[Fri Dec 26 23:00:00 2014, Sat Dec 27 23:00:00 2014, Sun Dec 28 23:00:00 2014]