diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-01-23 22:58:04 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-01-23 22:58:04 +0000 |
commit | 591bb6b492edbfcb868ef690c8fc622a5ca2f58e (patch) | |
tree | b6a17353aa84e96e89e743770ba3824099f884d4 /src/net/cbaines/suma/Stop.java | |
parent | 63e1cb8f84d9530066caa4b2bf98a4b691ff830c (diff) | |
download | southamptonuniversitymap-591bb6b492edbfcb868ef690c8fc622a5ca2f58e.tar southamptonuniversitymap-591bb6b492edbfcb868ef690c8fc622a5ca2f58e.tar.gz |
Refactored BusTimeActivity to BusStopActivity, Fixed issue with Timetables, and Activity rotation. Also added some basic effects to the stop list.
Diffstat (limited to 'src/net/cbaines/suma/Stop.java')
-rw-r--r-- | src/net/cbaines/suma/Stop.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/net/cbaines/suma/Stop.java b/src/net/cbaines/suma/Stop.java index 6e6bd39..2fa8d33 100644 --- a/src/net/cbaines/suma/Stop.java +++ b/src/net/cbaines/suma/Stop.java @@ -75,4 +75,50 @@ public class Stop { return (String) DateUtils.getRelativeTimeSpanString(arivalTime.getTime(), System.currentTimeMillis(), DateUtils.MINUTE_IN_MILLIS); } } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((arivalTime == null) ? 0 : arivalTime.hashCode()); + result = prime * result + ((bus == null) ? 0 : bus.hashCode()); + result = prime * result + ((busStop == null) ? 0 : busStop.hashCode()); + result = prime * result + id; + return result; + } + + @Override + public String toString() { + return "Stop [id=" + id + ", bus=" + bus + ", busStop=" + busStop + ", arivalTime=" + arivalTime + "]"; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Stop other = (Stop) obj; + if (arivalTime == null) { + if (other.arivalTime != null) + return false; + } else if (!arivalTime.equals(other.arivalTime)) + return false; + if (bus == null) { + if (other.bus != null) + return false; + } else if (!bus.equals(other.bus)) + return false; + if (busStop == null) { + if (other.busStop != null) + return false; + } else if (!busStop.equals(other.busStop)) + return false; + if (id != other.id) + return false; + return true; + } + } |