| 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 IncidentActivities implements Serializable |
|---|
| 11 | { |
|---|
| 12 | private String vehicle; |
|---|
| 13 | private String activity; |
|---|
| 14 | private String location; |
|---|
| 15 | private String comment; |
|---|
| 16 | private String disp; |
|---|
| 17 | |
|---|
| 18 | private static enum ACTIVITIES_ENUMS |
|---|
| 19 | { |
|---|
| 20 | VEHICLE ("VEHICLE"), |
|---|
| 21 | ACTIVITY ("ACTIVITY"), |
|---|
| 22 | LOCATION ("LOCATION"), |
|---|
| 23 | COMMENT ("COMMENT"), |
|---|
| 24 | DISP ("DISP"); |
|---|
| 25 | |
|---|
| 26 | public String tag; |
|---|
| 27 | |
|---|
| 28 | private ACTIVITIES_ENUMS(String t) |
|---|
| 29 | { |
|---|
| 30 | tag = t; |
|---|
| 31 | } |
|---|
| 32 | } |
|---|
| 33 | |
|---|
| 34 | /* |
|---|
| 35 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 36 | */ |
|---|
| 37 | public IncidentActivities(){ |
|---|
| 38 | vehicle = ""; |
|---|
| 39 | activity = ""; |
|---|
| 40 | location = ""; |
|---|
| 41 | comment = ""; |
|---|
| 42 | disp = ""; |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | public String getVehicle() { |
|---|
| 46 | return vehicle; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | public void setVehicle(String vehicle) { |
|---|
| 50 | this.vehicle = vehicle; |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | public String getActivity() { |
|---|
| 54 | return activity; |
|---|
| 55 | } |
|---|
| 56 | |
|---|
| 57 | public void setActivity(String activity) { |
|---|
| 58 | this.activity = activity; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | public String getLocation() { |
|---|
| 62 | return location; |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | public void setLocation(String location) { |
|---|
| 66 | this.location = location; |
|---|
| 67 | } |
|---|
| 68 | |
|---|
| 69 | public String getComment() { |
|---|
| 70 | return comment; |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | public void setComment(String comment) { |
|---|
| 74 | this.comment = comment; |
|---|
| 75 | } |
|---|
| 76 | |
|---|
| 77 | public String getDisp() { |
|---|
| 78 | return disp; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | public void setDisp(String disp) { |
|---|
| 82 | this.disp = disp; |
|---|
| 83 | } |
|---|
| 84 | |
|---|
| 85 | /* |
|---|
| 86 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag. |
|---|
| 87 | */ |
|---|
| 88 | public void readXMLNode(String tag_name, String value) { |
|---|
| 89 | if(tag_name.equals(ACTIVITIES_ENUMS.VEHICLE.tag)) |
|---|
| 90 | { |
|---|
| 91 | setVehicle(value); |
|---|
| 92 | } |
|---|
| 93 | else if(tag_name.equals(ACTIVITIES_ENUMS.ACTIVITY.tag)) |
|---|
| 94 | { |
|---|
| 95 | setActivity(value); |
|---|
| 96 | } |
|---|
| 97 | else if(tag_name.equals(ACTIVITIES_ENUMS.LOCATION.tag)) |
|---|
| 98 | { |
|---|
| 99 | setLocation(value); |
|---|
| 100 | } |
|---|
| 101 | else if(tag_name.equals(ACTIVITIES_ENUMS.COMMENT.tag)) |
|---|
| 102 | { |
|---|
| 103 | setComment(value); |
|---|
| 104 | } |
|---|
| 105 | else if(tag_name.equals(ACTIVITIES_ENUMS.DISP.tag)) |
|---|
| 106 | { |
|---|
| 107 | setDisp(value); |
|---|
| 108 | } |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | } |
|---|