org.openstreetmap.osmosis.core.xml.v0_5
Class XmlReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.xml.v0_5.XmlReader
All Implemented Interfaces:
java.lang.Runnable, Task, RunnableSource, Source

public class XmlReader
extends java.lang.Object
implements RunnableSource

An OSM data source reading from an xml file. The entire contents of the file are read.

Author:
Brett Henderson

Constructor Summary
XmlReader(java.io.File file, boolean enableDateParsing, CompressionMethod compressionMethod)
          Creates a new instance.
 
Method Summary
 void run()
          Reads all data from the file and send it to the sink.
 void setSink(Sink sink)
          Sets the osm sink to send data to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlReader

public XmlReader(java.io.File file,
                 boolean enableDateParsing,
                 CompressionMethod compressionMethod)
Creates a new instance.

Parameters:
file - The file to read.
enableDateParsing - If true, dates will be parsed from xml data, else the current date will be used thus saving parsing time.
compressionMethod - Specifies the compression method to employ.
Method Detail

setSink

public void setSink(Sink sink)
Sets the osm sink to send data to.

Specified by:
setSink in interface Source
Parameters:
sink - The sink for receiving all produced data.

run

public void run()
Reads all data from the file and send it to the sink.

Specified by:
run in interface java.lang.Runnable