org.openstreetmap.josm.io
Class AbstractReader

java.lang.Object
  extended by org.openstreetmap.josm.io.AbstractReader
Direct Known Subclasses:
OsmReader

public abstract class AbstractReader
extends java.lang.Object

Abstract Reader, allowing other implementations than OsmReader (PbfReader in PBF plugin for example)


Field Summary
protected  DataSet ds
          The dataset to add parsed objects to.
protected  java.util.Map<PrimitiveId,OsmPrimitive> externalIdMap
          the map from external ids to read OsmPrimitives.
protected  java.util.Map<java.lang.Long,java.util.Collection<RelationMemberData>> relations
          Data structure for relation objects
protected  Changeset uploadChangeset
           
protected  java.util.Map<java.lang.Long,java.util.Collection<java.lang.Long>> ways
          Data structure for the remaining way objects
 
Constructor Summary
AbstractReader()
           
 
Method Summary
 DataSet getDataSet()
          Replies the parsed data set
protected  void prepareDataSet()
           
protected  void processChangesetAfterParsing()
           
protected  void processNodesAfterParsing()
          Processes the parsed nodes after parsing.
protected  void processRelationsAfterParsing()
          Completes the parsed relations with its members.
protected  void processWaysAfterParsing()
          Processes the ways after parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ds

protected DataSet ds
The dataset to add parsed objects to.


uploadChangeset

protected Changeset uploadChangeset

externalIdMap

protected final java.util.Map<PrimitiveId,OsmPrimitive> externalIdMap
the map from external ids to read OsmPrimitives. External ids are longs too, but in contrast to internal ids negative values are used to identify primitives unknown to the OSM server


ways

protected final java.util.Map<java.lang.Long,java.util.Collection<java.lang.Long>> ways
Data structure for the remaining way objects


relations

protected final java.util.Map<java.lang.Long,java.util.Collection<RelationMemberData>> relations
Data structure for relation objects

Constructor Detail

AbstractReader

public AbstractReader()
Method Detail

getDataSet

public DataSet getDataSet()
Replies the parsed data set

Returns:
the parsed data set

processNodesAfterParsing

protected void processNodesAfterParsing()
Processes the parsed nodes after parsing. Just adds them to the dataset


processWaysAfterParsing

protected void processWaysAfterParsing()
                                throws IllegalDataException
Processes the ways after parsing. Rebuilds the list of nodes of each way and adds the way to the dataset

Throws:
IllegalDataException - thrown if a data integrity problem is detected

processRelationsAfterParsing

protected void processRelationsAfterParsing()
                                     throws IllegalDataException
Completes the parsed relations with its members.

Throws:
IllegalDataException - thrown if a data integrity problem is detected, i.e. if a relation member refers to a local primitive which wasn't available in the data

processChangesetAfterParsing

protected void processChangesetAfterParsing()

prepareDataSet

protected final void prepareDataSet()
                             throws IllegalDataException
Throws:
IllegalDataException


JOSM