info.aduna.collections.iterators
Class LimitIterator<E>
java.lang.Object
info.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.IterationWrapper<E,X>
info.aduna.iteration.LimitIteration<E,RuntimeException>
info.aduna.collections.iterators.LimitIterator<E>
- All Implemented Interfaces:
- CloseableIterator<E>, CloseableIteration<E,RuntimeException>, Iteration<E,RuntimeException>, Closeable, Iterator<E>
public class LimitIterator<E>
- extends LimitIteration<E,RuntimeException>
- implements CloseableIterator<E>
An iterator that limits the amount of elements that it returns from an
underlying iterator to a fixed amount. This class returns the first
limit elements from the underlying iterator and drops the rest.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LimitIterator
public LimitIterator(Iterator<? extends E> iter,
int limit)
- Creates a new LimitIterator.
- Parameters:
iter - The underlying iterator, must not be null.limit - The number of query answers to return, must be larger than 0.
Copyright © 1997-2008 Aduna. All Rights Reserved.