org.openstreetmap.osmosis.core.pgsql.v0_5.impl
Class RelationReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.pgsql.v0_5.impl.RelationReader
All Implemented Interfaces:
java.util.Iterator<Relation>, Releasable, ReleasableIterator<Relation>

public class RelationReader
extends java.lang.Object
implements ReleasableIterator<Relation>

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

Author:
Brett Henderson

Constructor Summary
RelationReader(DatabaseContext dbCtx)
          Creates a new instance.
RelationReader(DatabaseContext dbCtx, java.lang.String constraintTable)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 Relation next()
          
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 void remove()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationReader

public RelationReader(DatabaseContext dbCtx)
Creates a new instance.

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

RelationReader

public RelationReader(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

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<Relation>

next

public Relation next()

Specified by:
next in interface java.util.Iterator<Relation>

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<Relation>

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