Changeset 38 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/MyScriptHandler.java


Ignore:
Timestamp:
08/03/2017 04:30:19 PM (9 years ago)
Author:
bmcguffin
Message:

Removed the newLine at the end of each openTag method.

File:
1 edited

Legend:

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

    r37 r38  
    244244        incidentMap = new TreeMap<Integer, ScriptIncident>(); 
    245245        eventMap = new TreeMap<ELEMENT, I_ScriptEvent>(); 
     246        unitMap = new TreeMap<String, Unit>(); 
    246247        pcData = new TreeMap<ELEMENT, String>(); 
    247248        docPosition = new Stack<ELEMENT>(); 
     
    257258        return new Vector<ScriptIncident>(incidentMap.values()); 
    258259    } 
     260     
     261    /** 
     262     * Get the list of units that have been parsed from the script file. 
     263     * 
     264     * @returns Vector of Unit objects. 
     265     */ 
     266    public Vector<Unit> getUnits() 
     267    { 
     268        return new Vector<Unit>(unitMap.values()); 
     269    } 
    259270 
    260271    /** 
     
    265276    { 
    266277        //System.out.println("STUB: Start the document"); 
    267         for (ELEMENT e : ELEMENT.values()) 
    268         { 
    269             pcData.put(e, null); 
    270         } 
     278         
    271279    } 
    272280 
     
    601609    public void endElement(String uri, String localName, String qName) 
    602610    { 
    603  
    604611        currentElement = docPosition.pop(); 
    605612        I_ScriptEvent newEvent = null; 
     
    791798            } 
    792799 
    793             else if (qName.equals(ELEMENT.INCIDENT.tag)) 
     800            else if (currentElement == ELEMENT.INCIDENT) 
    794801            { 
    795802                currentIncName = parsedValue.toString(); 
     
    805812 
    806813            } 
    807             else if (qName.equals(ELEMENT.NEW_UNIT)) 
     814            else if (currentElement == ELEMENT.NEW_UNIT) 
    808815            { 
    809816                if (unitMap.get(NewUnitNum) == null) 
     
    879886                        unit.Timer = pcData.remove(ELEMENT.TIMER); 
    880887                    } 
     888                    unitMap.put(NewUnitNum, unit); 
    881889                } 
    882890            } 
Note: See TracChangeset for help on using the changeset viewer.