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

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

public class EntityHistoryListReader
extends java.lang.Object
implements ReleasableIterator<java.util.List<ChangeContainer>>

Reads a history stream and groups all changes for a single entity into lists.


Constructor Summary
EntityHistoryListReader(ReleasableIterator<ChangeContainer> sourceIterator)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 java.util.List<ChangeContainer> 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

EntityHistoryListReader

public EntityHistoryListReader(ReleasableIterator<ChangeContainer> sourceIterator)
Creates a new instance.

Parameters:
sourceIterator - An iterator containing full entity history ordered by type, identifier and version.
Method Detail

hasNext

public boolean hasNext()

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

next

public java.util.List<ChangeContainer> next()

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

remove

public void remove()

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

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