Warning: Can't use blame annotator:
svn blame failed on trunk/src/scriptbuilder/structures/Location_Info.java: ("Can't find a temporary directory: Internal error", 20014)

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

Revision 44, 1.3 KB checked in by bmcguffin, 9 years ago (diff)

Filled out toXML method of LocationInfo? object.

RevLine 
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 = openTag(ELEMENT.LOCATION_INFO.tag + " ID=\"" + Location_ID + "\"");
24
25        output += openTag(ELEMENT.Route.tag);
26        output += Route;
27        output += closeTag(ELEMENT.Route.tag);
28
29        output += openTag(ELEMENT.Direction.tag);
30        output += Direction;
31        output += closeTag(ELEMENT.Direction.tag);
32
33        output += openTag(ELEMENT.Postmile.tag);
34        output += Postmile;
35        output += closeTag(ELEMENT.Postmile.tag);
36
37        output += openTag(ELEMENT.Location_type.tag);
38        output += Location_type;
39        output += closeTag(ELEMENT.Location_type.tag);
40
41        output += closeTag(ELEMENT.LOCATION_INFO.tag);
42
43        return output;
44    }
45
46    @Override
47    public String openTag(String s)
48    {
49        return "<" + s + ">";
50    }
51
52    @Override
53    public String closeTag(String s)
54    {
55        return "</" + s + ">\n";
56    }
57
58    @Override
59    public String emptyTag(String s)
60    {
61        return "<" + s + "/>\n";
62    }
63}
Note: See TracBrowser for help on using the repository browser.