org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class FeatureHistoryPopulator<Te extends Entity,Tf extends Storeable,Tdbf extends DbFeature<Tf>>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.FeatureHistoryPopulator<Te,Tf,Tdbf>
Type Parameters:
Te - The type of entity to be populated.
Tf - The type of feature to be added.
Tdbf - The database feature class type. This is extensible to allow other attributes to be added to features such as a sequence number.
All Implemented Interfaces:
FeaturePopulator<Te>, Releasable

public class FeatureHistoryPopulator<Te extends Entity,Tf extends Storeable,Tdbf extends DbFeature<Tf>>
extends java.lang.Object
implements FeaturePopulator<Te>

Populates entities with their features using a sorted data source.


Constructor Summary
FeatureHistoryPopulator(ReleasableIterator<DbFeatureHistory<Tdbf>> source, FeatureCollectionLoader<Te,Tf> featureLoader)
          Creates a new instance.
 
Method Summary
 void populateFeatures(Te entity)
          Populates the specified entity.
 void release()
          Performs resource cleanup tasks such as closing files, or database connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureHistoryPopulator

public FeatureHistoryPopulator(ReleasableIterator<DbFeatureHistory<Tdbf>> source,
                               FeatureCollectionLoader<Te,Tf> featureLoader)
Creates a new instance.

Parameters:
source - The feature source.
featureLoader - Provides access to the feature collection within the entity.
Method Detail

populateFeatures

public void populateFeatures(Te entity)
Populates the specified entity.

Specified by:
populateFeatures in interface FeaturePopulator<Te extends Entity>
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