| 1 | package tmcsim.cadmodels; |
|---|
| 2 | |
|---|
| 3 | import java.io.Serializable; |
|---|
| 4 | |
|---|
| 5 | /** |
|---|
| 6 | * This class is a further subdivision of Incident to hold data. |
|---|
| 7 | * @author Vincent |
|---|
| 8 | * |
|---|
| 9 | */ |
|---|
| 10 | public class IncidentGeneralInfo implements Serializable |
|---|
| 11 | { |
|---|
| 12 | private String id; |
|---|
| 13 | private String masterIncNum; |
|---|
| 14 | private String jurisdiction; |
|---|
| 15 | private String alarm; |
|---|
| 16 | private String agy; |
|---|
| 17 | |
|---|
| 18 | private static enum GENERAL_ENUMS |
|---|
| 19 | { |
|---|
| 20 | ID ("ID"), |
|---|
| 21 | JURISDICTION ("JURISDICTION"), |
|---|
| 22 | ALARM ("ALARM"), |
|---|
| 23 | AGY ("AGY"); |
|---|
| 24 | |
|---|
| 25 | public String tag; |
|---|
| 26 | |
|---|
| 27 | private GENERAL_ENUMS(String t) |
|---|
| 28 | { |
|---|
| 29 | tag = t; |
|---|
| 30 | } |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | /* |
|---|
| 34 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 35 | */ |
|---|
| 36 | public IncidentGeneralInfo(){ |
|---|
| 37 | jurisdiction = ""; |
|---|
| 38 | alarm = ""; |
|---|
| 39 | agy = ""; |
|---|
| 40 | } |
|---|
| 41 | |
|---|
| 42 | public String getJurisdiction() { |
|---|
| 43 | return jurisdiction; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | public void setJurisdiction(String jurisdiction) { |
|---|
| 47 | this.jurisdiction = jurisdiction; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | public String getAlarm() { |
|---|
| 51 | return alarm; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | public void setAlarm(String alarm) { |
|---|
| 55 | this.alarm = alarm; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | public String getAgy() { |
|---|
| 59 | return agy; |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | public void setAgy(String agy) { |
|---|
| 63 | this.agy = agy; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | public String getMasterIncNum() { |
|---|
| 67 | return masterIncNum; |
|---|
| 68 | } |
|---|
| 69 | |
|---|
| 70 | public void setMasterIncNum(String masterIncNum) { |
|---|
| 71 | this.masterIncNum = masterIncNum; |
|---|
| 72 | } |
|---|
| 73 | |
|---|
| 74 | public String getId() { |
|---|
| 75 | return id; |
|---|
| 76 | } |
|---|
| 77 | |
|---|
| 78 | public void setId(String id) { |
|---|
| 79 | this.id = id; |
|---|
| 80 | } |
|---|
| 81 | |
|---|
| 82 | /* |
|---|
| 83 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag. |
|---|
| 84 | */ |
|---|
| 85 | public void readXMLNode(String tag_name, String value) { |
|---|
| 86 | if(tag_name.equals(GENERAL_ENUMS.ID.tag)) |
|---|
| 87 | { |
|---|
| 88 | setId(value); |
|---|
| 89 | } |
|---|
| 90 | else if(tag_name.equals(GENERAL_ENUMS.JURISDICTION.tag)) |
|---|
| 91 | { |
|---|
| 92 | setJurisdiction(value); |
|---|
| 93 | } |
|---|
| 94 | else if(tag_name.equals(GENERAL_ENUMS.ALARM.tag)) |
|---|
| 95 | { |
|---|
| 96 | setAlarm(value); |
|---|
| 97 | } |
|---|
| 98 | else if(tag_name.equals(GENERAL_ENUMS.AGY.tag)) |
|---|
| 99 | { |
|---|
| 100 | setAgy(value); |
|---|
| 101 | } |
|---|
| 102 | } |
|---|
| 103 | |
|---|
| 104 | } |
|---|