1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.bus.entity;
16
17 import java.io.Serializable;
18 import java.util.ArrayList;
19 import java.util.List;
20 import javax.xml.bind.annotation.XmlElement;
21 import javax.xml.bind.annotation.XmlRootElement;
22 import javax.xml.bind.annotation.XmlSeeAlso;
23
24
25
26
27
28 @XmlRootElement(name="stop")
29 @XmlSeeAlso(ScheduledStopImpl.class)
30 public class BusStopImpl implements BusStop, Serializable {
31
32 private long id;
33
34 private String name;
35
36 private String latitude;
37 private String longitude;
38
39 private double distance;
40
41
42
43 @XmlElement( name="scheduledStops" )
44 private List<ScheduledStopImpl> schedule;
45
46
47
48
49 public long getId() {
50 return id;
51 }
52
53
54
55
56 public void setId(long id) {
57 this.id = id;
58 }
59
60
61
62
63 public String getName() {
64 return name;
65 }
66
67
68
69
70 public void setName(String name) {
71 this.name = name;
72 }
73
74
75
76
77 public String getLatitude() {
78 return latitude;
79 }
80
81
82
83
84 public void setLatitude(String latitude) {
85 this.latitude = latitude;
86 }
87
88
89
90
91 public String getLongitude() {
92 return longitude;
93 }
94
95
96
97
98 public void setLongitude(String longitude) {
99 this.longitude = longitude;
100 }
101
102
103
104
105 public List<ScheduledStopImpl> getSchedule() {
106 return schedule;
107 }
108
109
110
111
112 public void setSchedule(List<? extends ScheduledStop> newSchedule) {
113 this.schedule = (List<ScheduledStopImpl>)(List<?>)newSchedule;
114 }
115
116 public void addSchedule(ScheduledStop newSchedule) {
117 if( null == schedule ) {
118 setSchedule( new ArrayList<ScheduledStopImpl>() );
119 }
120 this.schedule.add((ScheduledStopImpl)newSchedule);
121 }
122
123 public boolean equals( Object o )
124 {
125 boolean isEqual = false;
126
127 if( o != null && o instanceof BusStop )
128 {
129 if( getName() != null && getName().equalsIgnoreCase( ((BusStop)o).getName() ) )
130 {
131 isEqual = true;
132 }
133 }
134
135 return isEqual;
136 }
137
138 public int hashCode()
139 {
140 return 41 + ( getName() == null ? 0 : getName().hashCode() );
141 }
142
143
144
145
146 public double getDistance() {
147 return distance;
148 }
149
150
151
152
153 public void setDistance(double distance) {
154 this.distance = distance;
155 }
156
157 }