org.openstreetmap.osmosis.core.store
Class IndexRangeIterator<K,T extends IndexElement<K>>

java.lang.Object
  extended by org.openstreetmap.osmosis.core.store.IndexRangeIterator<K,T>
Type Parameters:
K - The index key type.
T - The index record being stored.
All Implemented Interfaces:
java.util.Iterator<T>

public class IndexRangeIterator<K,T extends IndexElement<K>>
extends java.lang.Object
implements java.util.Iterator<T>

Iterates over specific range within an index source. It will skip records until it reaches the beginning of the range, and stop when it reaches the end of the range.

Author:
Brett Henderson

Constructor Summary
IndexRangeIterator(java.util.Iterator<T> source, K beginKey, K endKey, java.util.Comparator<K> ordering)
          Creates a new instance.
 
Method Summary
 boolean hasNext()
          
 T next()
          
 void remove()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexRangeIterator

public IndexRangeIterator(java.util.Iterator<T> source,
                          K beginKey,
                          K endKey,
                          java.util.Comparator<K> ordering)
Creates a new instance.

Parameters:
source - The input index source.
beginKey - The first key for which to return data.
endKey - The last key for which to return data.
ordering - The index key ordering to be used for comparing keys.
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<T extends IndexElement<K>>

next

public T next()

Specified by:
next in interface java.util.Iterator<T extends IndexElement<K>>

remove

public void remove()

Specified by:
remove in interface java.util.Iterator<T extends IndexElement<K>>