org.openstreetmap.osmosis.core.pgsql.v0_6.impl
Class WayReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityReader<Way>
      extended by org.openstreetmap.osmosis.core.pgsql.v0_6.impl.WayReader
All Implemented Interfaces:
java.util.Iterator<Way>, Releasable, ReleasableIterator<Way>

public class WayReader
extends EntityReader<Way>

Reads all ways from a database ordered by their identifier. It combines the output of the way table readers to produce fully configured way objects.

Author:
Brett Henderson

Constructor Summary
WayReader(DatabaseContext dbCtx)
          Creates a new instance.
WayReader(DatabaseContext dbCtx, java.lang.String constraintTable)
          Creates a new instance.
 
Method Summary
protected  void populateEntityFeatures(Way entity)
          Populates the entity with the its features.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 
Methods inherited from class org.openstreetmap.osmosis.core.pgsql.v0_6.impl.EntityReader
hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WayReader

public WayReader(DatabaseContext dbCtx)
Creates a new instance.

Parameters:
dbCtx - The database context to use for accessing the database.

WayReader

public WayReader(DatabaseContext dbCtx,
                 java.lang.String constraintTable)
Creates a new instance.

Parameters:
dbCtx - The database context to use for accessing the database.
constraintTable - The table containing a column named id defining the list of entities to be returned.
Method Detail

populateEntityFeatures

protected void populateEntityFeatures(Way entity)
Populates the entity with the its features. These features will be read from related tables.

Overrides:
populateEntityFeatures in class EntityReader<Way>
Parameters:
entity - The entity to be populated.

release

public void release()
Performs resource cleanup tasks such as closing files, or database connections. This must be called after all processing is complete and may be called multiple times. Implementations must call release on any nested Releasable objects. It should be called within a finally block to ensure it is called in exception scenarios.

Specified by:
release in interface Releasable
Overrides:
release in class EntityReader<Way>