KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lamatek > tags > google > beans > TrafficEventBean


1 package com.lamatek.tags.google.beans;
2
3 import java.text.SimpleDateFormat JavaDoc;
4 import java.util.Date JavaDoc;
5
6
7 public class TrafficEventBean {
8     
9     double longitude = 0.00d;
10     double latitude = 0.00d;
11     String JavaDoc title = null;
12     String JavaDoc description = null;
13     String JavaDoc type = null;
14     String JavaDoc direction = null;
15     Date JavaDoc reported = null;
16     Date JavaDoc updated = null;
17     Date JavaDoc ending = null;
18     int severity = 0;
19     /**
20      * Empty constructor for a traffic event. All valid traffic events
21      * must have a longitude, latitude and description defined to be
22      * displayed.
23      */

24     public TrafficEventBean() {
25     }
26     /**
27      * Returns the display content to show in the traffic event's info window which
28      * is displayed when the marker is clicked.
29      *
30      * @return An HTML formatted string description of the traffic event.
31      */

32     public String JavaDoc getContent() {
33         String JavaDoc contents = "<div style=\"text-align: left\">";
34         contents += "<table>";
35         contents += "<tr><th colspan=\"2\">" + title + "</th></tr>";
36         contents += "<tr><td colspan=\"2\" style=\"white-space: wrap\">" + description + "</td></tr>";
37         contents += "<tr><td>Severity:</td><td width=\"100%\">" + severity + "</td></tr>";
38         contents += "<tr><td>Direction:</td><td width=\"100%\">" + direction + "</td></tr>";
39         contents += "</table>";
40         contents += "</div>";
41         return EscapeChars.escape(contents);
42     }
43     /**
44      * Returns the text description for this traffic event.
45      *
46      * @return The text description for this traffic event.
47      */

48     public String JavaDoc getDescription() {
49         return description;
50     }
51     /**
52      * Sets the text description for this traffic event.
53      *
54      * @param String The text description for this traffic event.
55      */

56     public void setDescription(String JavaDoc description) {
57         this.description = description;
58     }
59     /**
60      * Returns the longitude location for this traffic event.
61      *
62      * @return The longitude for this traffoc event.
63      */

64     public double getLatitude() {
65         return latitude;
66     }
67     /**
68      * Sets the longitude location for this traffic event.
69      *
70      * @param double Denotes the longitude for this traffoc event.
71      */

72     public void setLatitude(double latitude) {
73         this.latitude = latitude;
74     }
75     /**
76      * Returns the longitude location for this traffic event.
77      *
78      * @return The longitude for this traffoc event.
79      */

80     public double getLongitude() {
81         return longitude;
82     }
83     /**
84      * Sets the longitude location for this traffic event.
85      *
86      * @param double Denotes the longitude for this traffoc event.
87      */

88     public void setLongitude(double longitude) {
89         this.longitude = longitude;
90     }
91     /**
92      * Returns the traffic event type. Valid values are incident and construction.
93      *
94      * @return The type of traffic event.
95      */

96     public String JavaDoc getType() {
97         return type;
98     }
99     /**
100      * Sets the type of traffic event. Valid values are incident and construction.
101      *
102      * @param String The event type.
103      */

104     public void setType(String JavaDoc type) {
105         this.type = type;
106     }
107     /**
108      * Returns the severity of the traffic event, ranging from 1 (least) to 5 (most severe).
109      *
110      * @return The event severity as an int.
111      */

112     public int getSeverity() {
113         return severity;
114     }
115     /**
116      * Sets the severity of this event. Valid values are 1 (least severe) to 5 (most severe).
117      *
118      * @param int The event severity.
119      */

120     public void setSeverity(int severity) {
121         this.severity = severity;
122     }
123     /**
124      * Returns a descriptive title of this traffic event.
125      *
126      * @return The title of this traffic event.
127      */

128     public String JavaDoc getTitle() {
129         return title;
130     }
131     /**
132      * Sets the descriptive title of this traffic event.
133      *
134      * @param String Descriptive title of the event.
135      */

136     public void setTitle(String JavaDoc title) {
137         this.title = title;
138     }
139     /**
140      * Returns the direction of the event (if it's an incident that affects one direction
141      * of a road, or null.
142      */

143     public String JavaDoc getDirection() {
144         return direction;
145     }
146     /**
147      * Sets the direction of traffic (NB, SB, EB or WB) affected by the incident.
148      *
149      * @param String The traffic direction affected.
150      */

151     public void setDirection(String JavaDoc direction) {
152         this.direction = direction;
153     }
154     /**
155      * Returns the expected ending date for this traffic event or null if the expected
156      * ending date is unknown.
157      *
158      * @return The expected ending date as a Date object.
159      */

160     public Date JavaDoc getEnding() {
161         return ending;
162     }
163     /**
164      * Sets the expected ending date for this traffic event.
165      *
166      * @param ending Expected ending date
167      */

168     public void setEnding(Date JavaDoc ending) {
169         this.ending = ending;
170     }
171     /**
172      * Returns the date this traffic event was reported.
173      *
174      * @return The date the event was reported.
175      */

176     public Date JavaDoc getReported() {
177         return reported;
178     }
179     /**
180      * Sets the date this traffic event was reported.
181      *
182      * @param reported The date the event was reported.
183      */

184     public void setReported(Date JavaDoc reported) {
185         this.reported = reported;
186     }
187     /**
188      * Returns the date the event was last updated.
189      *
190      * @return The date the event was last updated.
191      */

192     public Date JavaDoc getUpdated() {
193         return updated;
194     }
195     /**
196      * Sets the date the event was last updated.
197      *
198      * @param updated The date the event was last updated.
199      */

200     public void setUpdated(Date JavaDoc updated) {
201         this.updated = updated;
202     }
203 }
204
Popular Tags