net.kolls.railworld.io
Class RWMReader

java.lang.Object
  extended by net.kolls.railworld.io.RWMReader

public class RWMReader
extends java.lang.Object

Reads RWM (Rail World map) files in the XML format.

Author:
Steve Kollmansberger

Constructor Summary
RWMReader()
           
 
Method Summary
static RailSegment[] read(java.io.File f, MetaData toBeFilled)
          Reads from an RWM file and returns the rail segments and updates the given metadata.
static RailSegment[] read(java.net.URL f, MetaData toBeFilled)
          Reads from an RWM file and returns the rail segments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RWMReader

public RWMReader()
Method Detail

read

public static RailSegment[] read(java.net.URL f,
                                 MetaData toBeFilled)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException
Reads from an RWM file and returns the rail segments. Uses two passes.

Parameters:
f - URL of the RWM file
toBeFilled - An instance of MetaData to fill.
Returns:
An array of RailSegment representing all segments.
Throws:
org.xml.sax.SAXException - If the parser encounters an error.
java.io.IOException - If the URL cannot be read.

read

public static RailSegment[] read(java.io.File f,
                                 MetaData toBeFilled)
                          throws org.xml.sax.SAXException,
                                 java.io.IOException
Reads from an RWM file and returns the rail segments and updates the given metadata. Uses two passes.

Parameters:
f - File of the RWM file
toBeFilled - An instance of MetaData to fill.
Returns:
An array of RailSegment representing all segments.
Throws:
org.xml.sax.SAXException - If the parser encounters an error.
java.io.IOException - If the URL cannot be read.