info.aduna.collections.iterators
Class IntersectIterator<E>
java.lang.Object
info.aduna.iteration.CloseableIterationBase<E,X>
info.aduna.iteration.IterationWrapper<E,X>
info.aduna.iteration.FilterIteration<E,X>
info.aduna.iteration.IntersectIteration<E,RuntimeException>
info.aduna.collections.iterators.IntersectIterator<E>
- All Implemented Interfaces:
- CloseableIterator<E>, CloseableIteration<E,RuntimeException>, Iteration<E,RuntimeException>, Closeable, Iterator<E>
public class IntersectIterator<E>
- extends IntersectIteration<E,RuntimeException>
- implements CloseableIterator<E>
An iterator that returns the intersection of the results of two iterators.
Optionally, the iterator can be configured to filter duplicates from the
returned elements.
Note that duplicates can also be filtered by wrapping this iterator in a
DistinctIterator, but that has a bit more overhead as it adds a
second hash table lookup.
|
Constructor Summary |
IntersectIterator(Iterator<? extends E> arg1,
Iterator<? extends E> arg2)
Creates a new IntersectIterator that returns the intersection of the
results of two iterators. |
IntersectIterator(Iterator<? extends E> arg1,
Iterator<? extends E> arg2,
boolean distinct)
Creates a new IntersectIterator that returns the intersection of the
results of two iterators. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntersectIterator
public IntersectIterator(Iterator<? extends E> arg1,
Iterator<? extends E> arg2)
- Creates a new IntersectIterator that returns the intersection of the
results of two iterators. By default, duplicates are not
filtered from the results.
- Parameters:
arg1 - An iterator containing the first set of elements.arg2 - An iterator containing the second set of elements.
IntersectIterator
public IntersectIterator(Iterator<? extends E> arg1,
Iterator<? extends E> arg2,
boolean distinct)
- Creates a new IntersectIterator that returns the intersection of the
results of two iterators.
- Parameters:
arg1 - An iterator containing the first set of elements.arg2 - An iterator containing the second set of elements.distinct - Flag indicating whether duplicate elements should be filtered from
the result.
Copyright © 1997-2008 Aduna. All Rights Reserved.