faa.tg.scenario.importer
Class AirportXmlFileMerger

java.lang.Object
  extended by faa.tg.scenario.importer.XmlDomImporter
      extended by faa.tg.scenario.importer.AirportXmlFileMerger
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class AirportXmlFileMerger
extends XmlDomImporter

 This program takes in three input files - an airport file, an approach file, and a runway file
 and one output file and merges them.  Each approach is put into its corresponding runway
 and then each runway is put into its corresponding airport.  The new tree is then output to 
 the given output file
  

Version:
$Id: AirportXmlFileMerger.java,v 3.7 2008/12/31 23:45:08 lykensj Exp $
Author:
Bethany Leffler See the source: AirportXmlFileMerger.java

Field Summary
private  org.w3c.dom.Document airportDoc
           
private  java.util.HashMap<java.lang.String,org.w3c.dom.Element> airportHash
           
static java.lang.String CVS_VERSION_ID
          The CVS Version ID
private  org.w3c.dom.Document runwayDoc
           
private  java.util.HashMap<java.lang.String,org.w3c.dom.Element> runwayHash
           
 
Fields inherited from class faa.tg.scenario.importer.XmlDomImporter
jdoc
 
Constructor Summary
AirportXmlFileMerger(java.io.File airportFile, java.io.File approachFile, java.io.File runwayFile, java.io.File outputFile)
          Constructor
 
Method Summary
static void main(java.lang.String[] args)
           
private  void outputNewTreeToFile(java.io.File outputFile)
          Outputs the entire tree to the given file
private  void populateAirportHash()
          Populates a hashmap of Airports keyed by AirportName
private  void populateRunwayHash()
          Populates a hashmap of Runways keyed by AptName+"/"+RwyName
private  void putApproachesIntoRunway(org.w3c.dom.Document approachDoc)
          Gets the Airport and Runway Name of each approach and then finds the corresponding runway from the runway hash.
private  void putRunwaysIntoAirport()
          Gets the Airport Name of each runway and then finds the corresponding airport from the airport hash.
 
Methods inherited from class faa.tg.scenario.importer.XmlDomImporter
error, fatalError, getBoolean, getElementNamed, getText, getXmlDocument, getXmlDocument, getXmlDocument, getXmlDocument, getXmlDocumentUsingSchema, makeSimpleElement, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_VERSION_ID

public static final java.lang.String CVS_VERSION_ID
The CVS Version ID

See Also:
Constant Field Values

airportHash

private java.util.HashMap<java.lang.String,org.w3c.dom.Element> airportHash

runwayHash

private java.util.HashMap<java.lang.String,org.w3c.dom.Element> runwayHash

airportDoc

private org.w3c.dom.Document airportDoc

runwayDoc

private org.w3c.dom.Document runwayDoc
Constructor Detail

AirportXmlFileMerger

public AirportXmlFileMerger(java.io.File airportFile,
                            java.io.File approachFile,
                            java.io.File runwayFile,
                            java.io.File outputFile)
Constructor

Parameters:
airportFile -
approachFile -
runwayFile -
outputFile -
Method Detail

populateAirportHash

private void populateAirportHash()
Populates a hashmap of Airports keyed by AirportName


populateRunwayHash

private void populateRunwayHash()
Populates a hashmap of Runways keyed by AptName+"/"+RwyName


putApproachesIntoRunway

private void putApproachesIntoRunway(org.w3c.dom.Document approachDoc)
Gets the Airport and Runway Name of each approach and then finds the corresponding runway from the runway hash. Once the runway element is retrieved, the approach's AirportName and RunwayName child elements are removed and it is added as a child element to the runway

Parameters:
approachDoc -

putRunwaysIntoAirport

private void putRunwaysIntoAirport()
Gets the Airport Name of each runway and then finds the corresponding airport from the airport hash. Once the airport element is retrieved, the runway's AirportName child element is removed and it is added as a child element to the airport


outputNewTreeToFile

private void outputNewTreeToFile(java.io.File outputFile)
Outputs the entire tree to the given file

Parameters:
airportNode -
outputFile -

main

public static void main(java.lang.String[] args)