| Revision 46,
1.1 KB
checked in by bmcguffin, 9 years ago
(diff) |
|
Added file: XMLWriter, in package Scriptbuilder.structures. It holds static methods which ither classes that implement I_XML_Writable may find useful. Also restructured the toXML method of many classes to utilize this new class.
|
| 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 | import scriptbuilder.structures.XMLWriter; |
|---|
| 12 | |
|---|
| 13 | /** |
|---|
| 14 | * Data model for a Tow event. A tow truck has a beat and a company, and two |
|---|
| 15 | * phone numbers: one public, and one for confirmation. |
|---|
| 16 | * |
|---|
| 17 | * @author Bryan McGuffin |
|---|
| 18 | */ |
|---|
| 19 | public class TowEvent extends ScriptEvent implements I_XML_Writable |
|---|
| 20 | { |
|---|
| 21 | |
|---|
| 22 | public TowEvent() |
|---|
| 23 | { |
|---|
| 24 | super(ScriptEventType.TOW_EVENT); |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | public String towBeat = ""; |
|---|
| 28 | |
|---|
| 29 | public String towCompany = ""; |
|---|
| 30 | |
|---|
| 31 | public String towConfNum = ""; |
|---|
| 32 | |
|---|
| 33 | public String towPubNum = ""; |
|---|
| 34 | |
|---|
| 35 | @Override |
|---|
| 36 | public String toXML() |
|---|
| 37 | { |
|---|
| 38 | return XMLWriter.emptyTag(ELEMENT.TOW.tag + " Company=\"" + towCompany + "\" ConfNum=\"" |
|---|
| 39 | + towConfNum + "\" PubNum=\"" + towPubNum + "\" Beat=\"" + towBeat + "\""); |
|---|
| 40 | } |
|---|
| 41 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.