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

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

Initial Import of project files

Line 
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 IncidentCallBacks implements Serializable
11{
12    private String initial;
13    private String comment;
14   
15    private static enum CALL_BACKS_ENUMS
16    {
17        INITIAL     ("INITIAL"),
18        COMMENT   ("COMMENT");
19       
20        public String tag;
21       
22        private CALL_BACKS_ENUMS(String t)
23        {
24            tag = t;
25        }
26    }
27   
28    /*
29     * Constructor. Initializes all objects to avoid null pointers.
30     */
31    public IncidentCallBacks(){
32        initial = "";
33        comment = "";
34    }
35   
36    public String getInitial() {
37        return initial;
38    }
39   
40    public void setInitial(String initial) {
41        this.initial = initial;
42    }
43
44    public String getComment() {
45        return comment;
46    }
47
48    public void setComment(String comment) {
49        this.comment = comment;
50    }
51   
52    /*
53     * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag.
54     */
55    public void readXMLNode(String tag_name, String value) {
56        if(tag_name.equals(CALL_BACKS_ENUMS.INITIAL.tag))
57        {
58            setInitial(value);
59        }
60        else if(tag_name.equals(CALL_BACKS_ENUMS.COMMENT.tag))
61        {
62            setComment(value);
63        }
64    }
65   
66}
Note: See TracBrowser for help on using the repository browser.