diff options
Diffstat (limited to 'src/net/cbaines/suma/Timetable.java')
-rw-r--r-- | src/net/cbaines/suma/Timetable.java | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/net/cbaines/suma/Timetable.java b/src/net/cbaines/suma/Timetable.java index 93c8e8d..5b26d24 100644 --- a/src/net/cbaines/suma/Timetable.java +++ b/src/net/cbaines/suma/Timetable.java @@ -24,46 +24,46 @@ import java.util.Date; public class Timetable extends ArrayList<Stop> { - /** + /** * */ - private static final long serialVersionUID = -9021303378059511643L; + private static final long serialVersionUID = -9021303378059511643L; - Date fetchTime; + Date fetchTime; - public String toString() { - StringBuilder sb = new StringBuilder(); - for (Stop stop : this) { - sb.append(stop + "\n"); + public String toString() { + StringBuilder sb = new StringBuilder(); + for (Stop stop : this) { + sb.append(stop + "\n"); + } + return sb.toString(); } - return sb.toString(); - } - 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)) { - if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { - return true; - } - } else if (otherStop.busStop.equals(stop.busStop)) { - 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; + 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)) { + if (Math.abs(otherStop.arivalTime.getTime() - stop.arivalTime.getTime()) < 60000) { + return true; + } + } else if (otherStop.busStop.equals(stop.busStop)) { + 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; + } + } + } } - } + return false; + } else { + return this.contains(otherStop); } - } - return false; - } else { - return this.contains(otherStop); } - } } |