| Revision 2,
1.5 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 IncidentProblem implements Serializable |
|---|
| 11 | { |
|---|
| 12 | private String problemCode; |
|---|
| 13 | private String priority; |
|---|
| 14 | |
|---|
| 15 | private static enum PROBLEM_ENUMS |
|---|
| 16 | { |
|---|
| 17 | CODE ("CODE"), |
|---|
| 18 | PRIORITY ("PRIORITY"); |
|---|
| 19 | |
|---|
| 20 | public String tag; |
|---|
| 21 | |
|---|
| 22 | private PROBLEM_ENUMS(String t) |
|---|
| 23 | { |
|---|
| 24 | tag = t; |
|---|
| 25 | } |
|---|
| 26 | } |
|---|
| 27 | |
|---|
| 28 | /* |
|---|
| 29 | * Constructor. Initializes all objects to avoid null pointers. |
|---|
| 30 | */ |
|---|
| 31 | public IncidentProblem(String code, String prio) |
|---|
| 32 | { |
|---|
| 33 | setProblemCode(code); |
|---|
| 34 | setPriority(prio); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | public IncidentProblem() |
|---|
| 38 | { |
|---|
| 39 | problemCode = ""; |
|---|
| 40 | priority = ""; |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | public String getProblemCode() { |
|---|
| 44 | return problemCode; |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | public void setProblemCode(String problemCode) { |
|---|
| 48 | this.problemCode = problemCode; |
|---|
| 49 | } |
|---|
| 50 | |
|---|
| 51 | public String getPriority() { |
|---|
| 52 | return priority; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | public void setPriority(String priority) { |
|---|
| 56 | this.priority = priority; |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | /* |
|---|
| 60 | * Called from the tmc.simulator.cadclient.data.Incident.java. Handles storing data based on script tag. |
|---|
| 61 | */ |
|---|
| 62 | public void readXMLNode(String tag_name, String value) { |
|---|
| 63 | if(tag_name.equals(PROBLEM_ENUMS.CODE.tag)) |
|---|
| 64 | { |
|---|
| 65 | setProblemCode(value); |
|---|
| 66 | } |
|---|
| 67 | else if(tag_name.equals(PROBLEM_ENUMS.PRIORITY.tag)) |
|---|
| 68 | { |
|---|
| 69 | setPriority(value); |
|---|
| 70 | } |
|---|
| 71 | } |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.