diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-02-24 15:01:41 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-02-24 15:01:41 +0000 |
commit | 59f31dd97ddc3f3f918a432ea4e20552c3006d97 (patch) | |
tree | 7477656e08f6aaff1849d25cd593cd0510bc7d1f /src/net/cbaines/suma/Timetable.java | |
parent | 46143c64dbdcbbfb478b2df4949c617682427d63 (diff) | |
parent | a02e8ae9eed3b2e3c105db19e84c27a0774172dd (diff) | |
download | southamptonuniversitymap-59f31dd97ddc3f3f918a432ea4e20552c3006d97.tar southamptonuniversitymap-59f31dd97ddc3f3f918a432ea4e20552c3006d97.tar.gz |
Merge branch 'dev' into dev-rdf
Conflicts:
src/net/cbaines/suma/BuildingActivity.java
Diffstat (limited to 'src/net/cbaines/suma/Timetable.java')
-rw-r--r-- | src/net/cbaines/suma/Timetable.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/net/cbaines/suma/Timetable.java b/src/net/cbaines/suma/Timetable.java index 6e3db1e..93c8e8d 100644 --- a/src/net/cbaines/suma/Timetable.java +++ b/src/net/cbaines/suma/Timetable.java @@ -28,7 +28,7 @@ public class Timetable extends ArrayList<Stop> { * */ private static final long serialVersionUID = -9021303378059511643L; - + Date fetchTime; public String toString() { @@ -40,6 +40,8 @@ public class Timetable extends ArrayList<Stop> { } public boolean contains(Stop otherStop, boolean toTheMinute) { + if (otherStop == null) + return false; if (toTheMinute) { for (Stop stop : this) { if (otherStop.bus != null && stop.bus != null && otherStop.bus.equals(stop.bus)) { @@ -47,8 +49,14 @@ public class Timetable extends ArrayList<Stop> { return true; } } else if (otherStop.busStop.equals(stop.busStop)) { - if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { + if (otherStop.arivalTime == null && stop.arivalTime == null) { return true; + } else { + if (otherStop.arivalTime == null || stop.arivalTime == null) { + return false; + } else if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { + return true; + } } } } |