Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.Serializable;
- /**
- * This class is a further subdivision of Incident to hold data.
- *
- * @author Vincent
- *
- */
- public class IncidentProblem implements Serializable
- {
- enum INC_PROBLEM
- {
- PROBLEM, CODE, PRIORITY;
- }
- /* The init variables are set only from the XML script (readXMLNode method)
- * and are only used for resetCADDataSimulation purposes
- */
- private String init_problem = "";
- private String init_problemCode = "";
- private String init_priority = "";
- private String problem;
- private String problemCode;
- private String priority;
- /*
- * Constructor. Initializes all objects to avoid null pointers.
- */
- public IncidentProblem(String code, String prio)
- {
- problem = "";
- setProblemCode(code);
- setPriority(prio);
- }
- public IncidentProblem()
- {
- problem = "";
- problemCode = "";
- priority = "";
- }
- public void resetCADDataSimulation()
- {
- problem = init_problem;
- problemCode = init_problemCode;
- priority = init_priority;
- }
- public String getProblem()
- {
- return problem;
- }
- public void setProblem(String problem)
- {
- this.problem = problem;
- }
- public String getProblemCode()
- {
- return problemCode;
- }
- public void setProblemCode(String problemCode)
- {
- this.problemCode = problemCode;
- }
- public String getPriority()
- {
- return priority;
- }
- public void setPriority(String priority)
- {
- this.priority = priority;
- }
- /*
- * Called from the tmc.simulator.cadclient.data.Incident.java. Handles
- * storing data based on script tag.
- */
- public void readXMLNode(String tag_name, String value)
- {
- if (tag_name.equals(INC_PROBLEM.PROBLEM.toString()))
- {
- init_problem = value;
- setProblem(value);
- } else if (tag_name.equals(INC_PROBLEM.CODE.toString()))
- {
- init_problemCode = value;
- setProblemCode(value);
- } else if (tag_name.equals(INC_PROBLEM.PRIORITY.toString()))
- {
- init_priority = value;
- setPriority(value);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement