org.openstreetmap.osmosis.core.store
Class SubObjectStreamIterator<T extends Storeable>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.store.ObjectDataInputIterator<T>
      extended by org.openstreetmap.osmosis.core.store.ObjectStreamIterator<T>
          extended by org.openstreetmap.osmosis.core.store.SubObjectStreamIterator<T>
Type Parameters:
T - The type of data to be returned by the iterator.
All Implemented Interfaces:
java.util.Iterator<T>, Releasable, ReleasableIterator<T>

public class SubObjectStreamIterator<T extends Storeable>
extends ObjectStreamIterator<T>

This class reads objects from an ObjectInputStream until the end of stream is reached or a maximum number of objects is reached.

Author:
Brett Henderson

Constructor Summary
SubObjectStreamIterator(java.io.DataInputStream inStream, ObjectReader objectReader, long maxObjectCount)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 T next()
          
 
Methods inherited from class org.openstreetmap.osmosis.core.store.ObjectStreamIterator
release
 
Methods inherited from class org.openstreetmap.osmosis.core.store.ObjectDataInputIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
remove
 

Constructor Detail

SubObjectStreamIterator

public SubObjectStreamIterator(java.io.DataInputStream inStream,
                               ObjectReader objectReader,
                               long maxObjectCount)
Creates a new instance.

Parameters:
inStream - The stream to read objects from.
objectReader - The reader containing the objects to be deserialized.
maxObjectCount - The maximum number of objects to read.
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<T extends Storeable>
Overrides:
hasNext in class ObjectDataInputIterator<T extends Storeable>

next

public T next()

Specified by:
next in interface java.util.Iterator<T extends Storeable>
Overrides:
next in class ObjectDataInputIterator<T extends Storeable>