org.openstreetmap.osmosis.core.apidb.v0_6.impl
Class EntitySnapshotReader

java.lang.Object
  extended by org.openstreetmap.osmosis.core.apidb.v0_6.impl.EntitySnapshotReader
All Implemented Interfaces:
java.util.Iterator<EntityContainer>, Releasable, ReleasableIterator<EntityContainer>

public class EntitySnapshotReader
extends java.lang.Object
implements ReleasableIterator<EntityContainer>

Produces a snapshot at a point in time from a complete history stream.

Author:
Brett Henderson

Constructor Summary
EntitySnapshotReader(ReleasableIterator<ChangeContainer> sourceIterator, java.util.Date snapshotInstant)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 EntityContainer 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

EntitySnapshotReader

public EntitySnapshotReader(ReleasableIterator<ChangeContainer> sourceIterator,
                            java.util.Date snapshotInstant)
Creates a new instance.

Parameters:
sourceIterator - An iterator containing the full history for entities.
snapshotInstant - The state of the entity at this point in time will be dumped. This ensures a consistent snapshot.
Method Detail

hasNext

public boolean hasNext()

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

next

public EntityContainer next()

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

remove

public void remove()

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

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