Object[] users = list.toArray();
Arrays.sort(users, new ListFileUtilComparator());
---------------
public class ListFileUtilComparator implements Comparator<Object>
{
public int compare(Object obj1, Object obj2)
{
FileUpdate fileUpdate = (FileUpdate)obj1;
FileUpdate fileUpdate2 = (FileUpdate)obj2;
if (DateTimeUtil.detailTimeToLong(fileUpdate.getDate()) > DateTimeUtil.detailTimeToLong(fileUpdate2.getDate()))
{
return -1;
}
return 1;
}
}
Arrays.sort(users, new ListFileUtilComparator());
---------------
public class ListFileUtilComparator implements Comparator<Object>
{
public int compare(Object obj1, Object obj2)
{
FileUpdate fileUpdate = (FileUpdate)obj1;
FileUpdate fileUpdate2 = (FileUpdate)obj2;
if (DateTimeUtil.detailTimeToLong(fileUpdate.getDate()) > DateTimeUtil.detailTimeToLong(fileUpdate2.getDate()))
{
return -1;
}
return 1;
}
}