org.apache.mahout.cf.taste.impl.common
Interface SkippingIterator<V>

All Superinterfaces:
Iterator<V>
All Known Subinterfaces:
LongPrimitiveIterator
All Known Implementing Classes:
AbstractLongPrimitiveIterator, FileLineIterator, LongPrimitiveArrayIterator, SamplingLongPrimitiveIterator

public interface SkippingIterator<V>
extends Iterator<V>

Adds ability to skip ahead in an iterator, perhaps more efficiently than by calling Iterator.next() repeatedly.


Method Summary
 void skip(int n)
          Skip the next n elements supplied by this Iterator.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

skip

void skip(int n)
Skip the next n elements supplied by this Iterator. If there are less than n elements remaining, this skips all remaining elements in the Iterator. This method has the same effect as calling Iterator.next() n times, except that it will never throw NoSuchElementException.



Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.