Warning: Can't use blame annotator:
svn blame failed on trunk/src/tmcsim/cadmodels/IncidentTransportInfo.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/trunk/src/tmcsim/cadmodels/IncidentTransportInfo.java @ 2

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

Initial Import of project files

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