source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/structures/Location_Info.java @ 46

Revision 46, 821 bytes 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 
1package scriptbuilder.structures;
2
3/**
4 *
5 * @author Bryan McGuffin
6 */
7class Location_Info implements I_XML_Writable
8{
9
10    public String Location_ID = "";
11
12    public String Route = "";
13
14    public String Direction = "";
15
16    public String Postmile = "";
17
18    public String Location_type = "";
19
20    @Override
21    public String toXML()
22    {
23        String output = XMLWriter.openTag(ELEMENT.LOCATION_INFO.tag + " ID=\"" + Location_ID + "\"");
24
25        output += XMLWriter.simpleTag(Route, ELEMENT.Route);
26
27        output += XMLWriter.simpleTag(Direction, ELEMENT.Direction);
28
29        output += XMLWriter.simpleTag(Postmile, ELEMENT.Postmile);
30
31        output += XMLWriter.simpleTag(Location_type, ELEMENT.Location_type);
32
33        output += XMLWriter.closeTag(ELEMENT.LOCATION_INFO.tag);
34
35        return output;
36    }
37}
Note: See TracBrowser for help on using the repository browser.