| Revision 2,
1.3 KB
checked in by jdalbey, 10 years ago
(diff) |
|
Initial Import of project files
|
| Rev | Line | |
|---|
| 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 IncidentResponse implements Serializable |
|---|
| 11 | { |
|---|
| 12 | private String plan; |
|---|
| 13 | private String area; |
|---|
| 14 | |
|---|
| 15 | private static enum RESPONSE_ENUMS |
|---|
| 16 | { |
|---|
| 17 | PLAN ("PLAN"), |
|---|
| 18 | AREA ("AREA"); |
|---|
| 19 | |
|---|
| 20 | public String tag; |
|---|
| 21 | |
|---|
| 22 | private RESPONSE_ENUMS(String t) |
|---|
| 23 | { |
|---|
| 24 | tag = t; |
|---|
| 25 | } |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | /* |
|---|
| 29 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 30 | */ |
|---|
| 31 | public IncidentResponse(){ |
|---|
| 32 | plan = ""; |
|---|
| 33 | area = ""; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | public String getPlan() { |
|---|
| 37 | return plan; |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | public void setPlan(String plan) { |
|---|
| 41 | this.plan = plan; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | public String getArea() { |
|---|
| 45 | return area; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | public void setArea(String area) { |
|---|
| 49 | this.area = area; |
|---|
| 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(RESPONSE_ENUMS.PLAN.tag)) |
|---|
| 57 | { |
|---|
| 58 | setPlan(value); |
|---|
| 59 | } |
|---|
| 60 | else if(tag_name.equals(RESPONSE_ENUMS.AREA.tag)) |
|---|
| 61 | { |
|---|
| 62 | setArea(value); |
|---|
| 63 | } |
|---|
| 64 | |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.