aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/Timetable.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-19 10:42:04 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-19 10:42:04 +0000
commit40bd59ae8615f05c8f9d1b542f35ae39f98c2f5d (patch)
treeb6a6fa2fdbb7009859ef0ca4616a8b9c59169440 /src/net/cbaines/suma/Timetable.java
parent4b4a5a0ebc7f285d7cdcfa1d72640dbc097bdbb2 (diff)
parenta02e8ae9eed3b2e3c105db19e84c27a0774172dd (diff)
downloadsouthamptonuniversitymap-40bd59ae8615f05c8f9d1b542f35ae39f98c2f5d.tar
southamptonuniversitymap-40bd59ae8615f05c8f9d1b542f35ae39f98c2f5d.tar.gz
Merge branch 'dev'
Conflicts: AndroidManifest.xml res/values/strings.xml
Diffstat (limited to 'src/net/cbaines/suma/Timetable.java')
-rw-r--r--src/net/cbaines/suma/Timetable.java12
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;
+ }
}
}
}