info.aduna.collections.iterators
Class MinusIterator<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.MinusIteration<E,RuntimeException>
info.aduna.collections.iterators.MinusIterator<E>
- All Implemented Interfaces:
- CloseableIterator<E>, CloseableIteration<E,RuntimeException>, Iteration<E,RuntimeException>, Closeable, Iterator<E>
public class MinusIterator<E>
- extends MinusIteration<E,RuntimeException>
- implements CloseableIterator<E>
An iterator that returns the results of an iterator (the left argument) minus
the results of another iterator (the right argument). 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 |
MinusIterator(Iterator<? extends E> leftArg,
Iterator<? extends E> rightArg)
Creates a new MinusIterator that returns the results of the left argument
minus the results of the right argument. |
MinusIterator(Iterator<? extends E> leftArg,
Iterator<? extends E> rightArg,
boolean distinct)
Creates a new MinusIterator that returns the results of the left argument
minus the results of the right argument. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MinusIterator
public MinusIterator(Iterator<? extends E> leftArg,
Iterator<? extends E> rightArg)
- Creates a new MinusIterator that returns the results of the left argument
minus the results of the right argument. By default, duplicates are
not filtered from the results.
- Parameters:
leftArg - An iterator containing the main set of elements.rightArg - An iterator containing the set of elements that should be filtered
from the main set.
MinusIterator
public MinusIterator(Iterator<? extends E> leftArg,
Iterator<? extends E> rightArg,
boolean distinct)
- Creates a new MinusIterator that returns the results of the left argument
minus the results of the right argument.
- Parameters:
leftArg - An iterator containing the main set of elements.rightArg - An iterator containing the set of elements that should be filtered
from the main set.distinct - Flag indicating whether duplicate elements should be filtered from
the result.
Copyright © 1997-2008 Aduna. All Rights Reserved.