| Revision 38,
1.3 KB
checked in by bmcguffin, 9 years ago
(diff) |
|
Removed the newLine at the end of each openTag method.
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | * To change this license header, choose License Headers in Project Properties. |
|---|
| 3 | * To change this template file, choose Tools | Templates |
|---|
| 4 | * and open the template in the editor. |
|---|
| 5 | */ |
|---|
| 6 | package scriptbuilder.structures.events; |
|---|
| 7 | |
|---|
| 8 | import scriptbuilder.structures.ELEMENT; |
|---|
| 9 | import scriptbuilder.structures.I_XML_Writable; |
|---|
| 10 | import scriptbuilder.structures.ScriptEvent; |
|---|
| 11 | |
|---|
| 12 | /** |
|---|
| 13 | * Data model for a Unit event. A unit has a status and an ID number, can be |
|---|
| 14 | * active, and can be the primary response unit. |
|---|
| 15 | * |
|---|
| 16 | * @author Bryan McGuffin |
|---|
| 17 | */ |
|---|
| 18 | public class UnitEvent extends ScriptEvent implements I_XML_Writable |
|---|
| 19 | { |
|---|
| 20 | |
|---|
| 21 | public UnitEvent() |
|---|
| 22 | { |
|---|
| 23 | super(ScriptEventType.UNIT_EVENT); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | public String unitActive = ""; |
|---|
| 27 | |
|---|
| 28 | public String unitPrimary = ""; |
|---|
| 29 | |
|---|
| 30 | public String unitStatus = ""; |
|---|
| 31 | |
|---|
| 32 | public String unitNum = ""; |
|---|
| 33 | |
|---|
| 34 | @Override |
|---|
| 35 | public String openTag(String s) |
|---|
| 36 | { |
|---|
| 37 | return "<" + s + ">"; |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | @Override |
|---|
| 41 | public String closeTag(String s) |
|---|
| 42 | { |
|---|
| 43 | return "</" + s + ">\n"; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | @Override |
|---|
| 47 | public String emptyTag(String s) |
|---|
| 48 | { |
|---|
| 49 | return "<" + s + "/>\n"; |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | @Override |
|---|
| 53 | public String toXML() |
|---|
| 54 | { |
|---|
| 55 | return emptyTag(ELEMENT.UNIT.tag+" UnitNum=\""+unitNum+"\" Status=\"" |
|---|
| 56 | +unitStatus+"\" Primary=\""+unitPrimary+"\" Active=\""+unitActive+"\""); |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.