Changeset 36 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/events/CMSEvaluationEvent.java
- Timestamp:
- 08/03/2017 09:26:21 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/events/CMSEvaluationEvent.java
r7 r36 7 7 8 8 import java.util.ArrayList; 9 import scriptbuilder.structures.ELEMENT; 10 import scriptbuilder.structures.I_XML_Writable; 9 11 import scriptbuilder.structures.ScriptEvent; 10 12 … … 15 17 * @author Bryan McGuffin 16 18 */ 17 public class CMSEvaluationEvent extends ScriptEvent implements I_EvaluationEvent 19 public class CMSEvaluationEvent extends ScriptEvent implements I_EvaluationEvent, I_XML_Writable 18 20 { 19 21 … … 56 58 expectedAction.remove(index); 57 59 } 60 61 @Override 62 public String toXML() 63 { 64 String output = openTag(ELEMENT.CMS_EVALUATION.tag+" cmsID=\""+cmsID+"\" type=\""+cmsType+"\""); 65 output += openTag(ELEMENT.LOCATION.tag); 66 output += location; 67 output += closeTag(ELEMENT.LOCATION.tag); 68 69 if(message.size() > 0) 70 { 71 output += openTag(ELEMENT.SAMPLE_MESSAGE.tag); 72 for(String str: message) 73 { 74 output += openTag(ELEMENT.CMS_LINE.tag); 75 output += str; 76 output += closeTag(ELEMENT.CMS_LINE.tag); 77 } 78 output += closeTag(ELEMENT.SAMPLE_MESSAGE.tag); 79 } 80 81 output += closeTag(ELEMENT.CMS_EVALUATION.tag); 82 83 return output; 84 } 85 86 @Override 87 public String openTag(String s) 88 { 89 return "<" + s + ">\n"; 90 } 91 92 @Override 93 public String closeTag(String s) 94 { 95 return "</" + s + ">\n"; 96 } 97 98 @Override 99 public String emptyTag(String s) 100 { 101 return "<" + s + "/>\n"; 102 } 58 103 }
Note: See TracChangeset
for help on using the changeset viewer.
