| 1 | package tmcsim.client.cadclientgui.data; |
|---|
| 2 | |
|---|
| 3 | import java.io.Serializable; |
|---|
| 4 | |
|---|
| 5 | import tmcsim.client.cadclientgui.enums.CADDataEnums; |
|---|
| 6 | |
|---|
| 7 | public class IncidentInfo implements Serializable { |
|---|
| 8 | |
|---|
| 9 | /* The init variables are set only from the XML script (readXMLNode method) |
|---|
| 10 | * and are only used for resetCADDataSimulation purposes |
|---|
| 11 | */ |
|---|
| 12 | private String init_callInit = ""; |
|---|
| 13 | private String init_callTaken = ""; |
|---|
| 14 | private String init_timeInQ = ""; |
|---|
| 15 | private String init_lastUpdated = ""; |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | private String callInit; |
|---|
| 19 | private String callTaken; |
|---|
| 20 | private String timeInQ; |
|---|
| 21 | private String lastUpdated; |
|---|
| 22 | |
|---|
| 23 | /* |
|---|
| 24 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 25 | */ |
|---|
| 26 | public IncidentInfo() { |
|---|
| 27 | callInit = ""; |
|---|
| 28 | callTaken = ""; |
|---|
| 29 | timeInQ = ""; |
|---|
| 30 | lastUpdated = ""; |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | public void resetCADDataSimulation(){ |
|---|
| 34 | callInit = init_callInit; |
|---|
| 35 | callTaken = init_callTaken; |
|---|
| 36 | timeInQ = init_timeInQ; |
|---|
| 37 | lastUpdated = init_lastUpdated; |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | public String getCallInit() { |
|---|
| 41 | return callInit; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | public void setCallInit(String callInit) { |
|---|
| 45 | this.callInit = callInit; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | public String getCallTaken() { |
|---|
| 49 | return callTaken; |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | public void setCallTaken(String callTaken) { |
|---|
| 53 | this.callTaken = callTaken; |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | public String getTimeInQ() { |
|---|
| 57 | return timeInQ; |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | public void setTimeInQ(String timeInQ) { |
|---|
| 61 | this.timeInQ = timeInQ; |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| 64 | public String getLastUpdated() { |
|---|
| 65 | return lastUpdated; |
|---|
| 66 | } |
|---|
| 67 | |
|---|
| 68 | public void setLastUpdated(String lastUpdated) { |
|---|
| 69 | this.lastUpdated = lastUpdated; |
|---|
| 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(CADDataEnums.INC_INFO.CALL_INITIATED.tag)) { |
|---|
| 78 | init_callInit = value; |
|---|
| 79 | setCallInit(value); |
|---|
| 80 | } else if (tag_name.equals(CADDataEnums.INC_INFO.CALL_TAKEN.tag)) { |
|---|
| 81 | init_callTaken = value; |
|---|
| 82 | setCallTaken(value); |
|---|
| 83 | } else if (tag_name.equals(CADDataEnums.INC_INFO.TIME_IN_Q.tag)) { |
|---|
| 84 | init_timeInQ = value; |
|---|
| 85 | setTimeInQ(value); |
|---|
| 86 | } else if (tag_name.equals(CADDataEnums.INC_INFO.LAST_UPDATED.tag)) { |
|---|
| 87 | init_lastUpdated = value; |
|---|
| 88 | setLastUpdated(value); |
|---|
| 89 | } |
|---|
| 90 | } |
|---|
| 91 | } |
|---|