org.aksw.commons.collections
Class WindowedSorterIterator<T>

java.lang.Object
  extended by org.aksw.commons.collections.SinglePrefetchIterator<T>
      extended by org.aksw.commons.collections.WindowedSorterIterator<T>
All Implemented Interfaces:
Iterator<T>, IClosable, IClosableIterator<T>

public class WindowedSorterIterator<T>
extends SinglePrefetchIterator<T>
implements IClosableIterator<T>


Constructor Summary
WindowedSorterIterator(Iterator<T> it, int maxBufferSize, Comparator<T> comparator)
           
 
Method Summary
 void close()
          An iterator must always free all resources once done with iteration.
protected  T prefetch()
           
static
<T> IClosableIterator<T>
wrap(Iterator<T> it, int maxBufferSize, Comparator<T> comparator)
           
 
Methods inherited from class org.aksw.commons.collections.SinglePrefetchIterator
finish, hasNext, next, 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
hasNext, next, remove
 

Constructor Detail

WindowedSorterIterator

public WindowedSorterIterator(Iterator<T> it,
                              int maxBufferSize,
                              Comparator<T> comparator)
Method Detail

wrap

public static <T> IClosableIterator<T> wrap(Iterator<T> it,
                                            int maxBufferSize,
                                            Comparator<T> comparator)

prefetch

protected T prefetch()
              throws Exception
Specified by:
prefetch in class SinglePrefetchIterator<T>
Throws:
Exception

close

public void close()
Description copied from class: SinglePrefetchIterator
An iterator must always free all resources once done with iteration. However, if iteration is aborted, this method should be called.

Specified by:
close in interface IClosable
Overrides:
close in class SinglePrefetchIterator<T>


Copyright © 2012. All Rights Reserved.