Changeset 44 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/Location_Info.java


Ignore:
Timestamp:
08/07/2017 03:09:15 PM (9 years ago)
Author:
bmcguffin
Message:

Filled out toXML method of LocationInfo? object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/Location_Info.java

    r39 r44  
    55 * @author Bryan McGuffin 
    66 */ 
    7 class Location_Info  
     7class Location_Info implements I_XML_Writable 
    88{ 
     9 
    910    public String Location_ID = ""; 
    10      
     11 
    1112    public String Route = ""; 
    12      
     13 
    1314    public String Direction = ""; 
    14      
     15 
    1516    public String Postmile = ""; 
    16      
     17 
    1718    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    } 
    1863} 
Note: See TracChangeset for help on using the changeset viewer.