--- android/TrainInfoCommon/src/dk/thoerup/android/traininfo/common/DepartureEntry.java 2011/07/08 15:39:44 1561 +++ android/TrainInfoCommon/src/dk/thoerup/android/traininfo/common/DepartureEntry.java 2011/07/08 16:26:09 1562 @@ -6,7 +6,7 @@ import org.simpleframework.xml.Root; @Root(name="train", strict=false) -public class DepartureEntry implements Comparable, Serializable { +public class DepartureEntry implements Serializable { @Element private String time; @@ -93,33 +93,4 @@ this.type = type; } - @Override - public int compareTo(DepartureEntry otherBean) { - String timeStr1 = time.replace(":","").trim(); - String timeStr2 = otherBean.time.replace(":","").trim(); - - int time1 = 0; - int time2 = 0; - - if (timeStr1.length() > 0) - time1 = Integer.parseInt(timeStr1); - - if (timeStr2.length() > 0) - time2 = Integer.parseInt(timeStr2); - - //work correctly when clock wraps around at midnight - if (Math.abs(time1-time2) < 1200) { - if (time1 > time2) - return 1; - else - return -1; - } else { - if (time1 < time2) - return 1; - else - return -1; - - } - - } }