org.openstreetmap.osmosis.core.mysql.v0_5.impl
Class BaseEntityReader<T>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.mysql.common.BaseTableReader<T>
      extended by org.openstreetmap.osmosis.core.mysql.v0_5.impl.BaseEntityReader<T>
Type Parameters:
T - The type of entity to retrieved.
All Implemented Interfaces:
java.util.Iterator<T>, Releasable, ReleasableIterator<T>
Direct Known Subclasses:
CurrentNodeReader, CurrentRelationTableReader, CurrentWayTableReader, NodeHistoryReader, NodeReader, RelationHistoryReader, RelationTableReader, WayHistoryReader, WayTableReader

public abstract class BaseEntityReader<T>
extends BaseTableReader<T>

Provides the base implementation of all database entity readers. This extends the base table reader with additional features used by top level entity readers.

Author:
Brett Henderson

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openstreetmap.osmosis.core.mysql.common.BaseTableReader
BaseTableReader.ReadResult<T>
 
Constructor Summary
BaseEntityReader(DatabaseLoginCredentials loginCredentials, boolean readAllUsers)
          Creates a new instance.
 
Method Summary
protected  OsmUser readUserField(boolean dataPublic, int userId, java.lang.String userName)
          Determines the appropriate user name to add to an entity based upon the user details provided.
 
Methods inherited from class org.openstreetmap.osmosis.core.mysql.common.BaseTableReader
createLastValue, createNextValue, createResultSet, hasNext, next, release, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEntityReader

public BaseEntityReader(DatabaseLoginCredentials loginCredentials,
                        boolean readAllUsers)
Creates a new instance.

Parameters:
loginCredentials - Contains all information required to connect to the database.
readAllUsers - If this flag is true, all users will be read from the database regardless of their public edits flag.
Method Detail

readUserField

protected OsmUser readUserField(boolean dataPublic,
                                int userId,
                                java.lang.String userName)
Determines the appropriate user name to add to an entity based upon the user details provided.

Parameters:
dataPublic - The value of the public edit flag for the user.
userId - The unique id of the user.
userName - The display name of the user.
Returns:
The appropriate user to add to the entity.