org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class EntityHistoryReader<T extends Entity>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.EntityHistoryReader<T>
Type Parameters:
T - The type of entity provided by this iterator.
All Implemented Interfaces:
java.util.Iterator<EntityHistory<T>>, Releasable, ReleasableIterator<EntityHistory<T>>

public class EntityHistoryReader<T extends Entity>
extends java.lang.Object
implements ReleasableIterator<EntityHistory<T>>

Provides a single iterator based on data provided by underlying iterators from each of the underlying entity and feature iterators. Each underlying iterator provides one component of the overall entity.


Constructor Summary
EntityHistoryReader(ReleasableIterator<EntityHistory<T>> entityIterator, ReleasableIterator<DbFeatureHistory<DbFeature<Tag>>> tagIterator, java.util.List<FeatureHistoryPopulator<T,?,?>> featurePopulators)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 EntityHistory<T> 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

EntityHistoryReader

public EntityHistoryReader(ReleasableIterator<EntityHistory<T>> entityIterator,
                           ReleasableIterator<DbFeatureHistory<DbFeature<Tag>>> tagIterator,
                           java.util.List<FeatureHistoryPopulator<T,?,?>> featurePopulators)
Creates a new instance.

Parameters:
entityIterator - The entity source.
tagIterator - The tag source.
featurePopulators - Populators to add entity specific features to the generated entities.
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<EntityHistory<T extends Entity>>

next

public EntityHistory<T> next()

Specified by:
next in interface java.util.Iterator<EntityHistory<T extends Entity>>

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<EntityHistory<T extends Entity>>

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