source: tmcsimulator/trunk/src/tmcsim/client/cadclientgui/data/IncidentTransportInfo.java @ 3

Revision 3, 2.1 KB checked in by jdalbey, 10 years ago (diff)

Initial Import of project files - cadclientgui

Line 
1package tmcsim.client.cadclientgui.data;
2
3import java.io.Serializable;
4
5/**
6 * NOT IN USE. Originally meant for TransportInfo Tab in IncidentViewer.
7 * This class is a
8 * further subdivision of Incident to hold data.
9 *
10 * @author Vincent
11 *
12 */
13public class IncidentTransportInfo implements Serializable {
14    private String name;
15    private String toCity;
16    private String toLocation;
17    private String toState;
18
19    private static enum TRANSPORT_INFO_ENUMS {
20        NAME("NAME"), TO_CITY("TO_CITY"), TO_LOCATION("TO_LOCATION"), TO_STATE(
21                "TO_STATE");
22
23        public String tag;
24
25        private TRANSPORT_INFO_ENUMS(String t) {
26            tag = t;
27        }
28    }
29
30    /*
31     * Constructor. Initializes all objects to avoid null pointers.
32     */
33    public IncidentTransportInfo() {
34        name = "";
35        toCity = "";
36        toLocation = "";
37        toState = "";
38    }
39
40    public String getName() {
41        return name;
42    }
43
44    public void setName(String name) {
45        this.name = name;
46    }
47
48    public String getToCity() {
49        return toCity;
50    }
51
52    public void setToCity(String toCity) {
53        this.toCity = toCity;
54    }
55
56    public String getToLocation() {
57        return toLocation;
58    }
59
60    public void setToLocation(String toLocation) {
61        this.toLocation = toLocation;
62    }
63
64    public String getToState() {
65        return toState;
66    }
67
68    public void setToState(String toState) {
69        this.toState = toState;
70    }
71
72    /*
73     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles
74     * storing data based on script tag.
75     */
76    public void readXMLNode(String tag_name, String value) {
77        if (tag_name.equals(TRANSPORT_INFO_ENUMS.NAME.tag)) {
78            setName(value);
79        } else if (tag_name.equals(TRANSPORT_INFO_ENUMS.TO_CITY.tag)) {
80            setToCity(value);
81        } else if (tag_name.equals(TRANSPORT_INFO_ENUMS.TO_LOCATION.tag)) {
82            setToLocation(value);
83        } else if (tag_name.equals(TRANSPORT_INFO_ENUMS.TO_STATE.tag)) {
84            setToState(value);
85        }
86    }
87}
Note: See TracBrowser for help on using the repository browser.