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

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

public class NodeReader
extends java.lang.Object
implements ReleasableIterator<Node>

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

Author:
Brett Henderson

Constructor Summary
NodeReader(DatabaseContext dbCtx)
          Creates a new instance.
NodeReader(DatabaseContext dbCtx, java.lang.String constraintTable)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 Node 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

NodeReader

public NodeReader(DatabaseContext dbCtx)
Creates a new instance.

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

NodeReader

public NodeReader(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<Node>

next

public Node next()

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

remove

public void remove()

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

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