public class IntersectIteration<E,X extends Exception> extends FilterIteration<E,X>
Note that duplicates can also be filtered by wrapping this Iteration in a
DistinctIteration, but that has a bit more overhead as it adds a
second hash table lookup.
wrappedIter| Constructor and Description |
|---|
IntersectIteration(Iteration<? extends E,? extends X> arg1,
Iteration<? extends E,? extends X> arg2)
Creates a new IntersectIteration that returns the intersection of the
results of two Iterations.
|
IntersectIteration(Iteration<? extends E,? extends X> arg1,
Iteration<? extends E,? extends X> arg2,
boolean distinct)
Creates a new IntersectIteration that returns the intersection of the
results of two Iterations.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(E object)
Returns true if the object is in the set of elements of the
second argument.
|
protected void |
handleClose()
Closed this Iteration and also closes the wrapped Iteration if it is a
CloseableIteration. |
hasNext, nextremoveclose, isClosedpublic IntersectIteration(Iteration<? extends E,? extends X> arg1, Iteration<? extends E,? extends X> arg2)
arg1 - An Iteration containing the first set of elements.arg2 - An Iteration containing the second set of elements.public IntersectIteration(Iteration<? extends E,? extends X> arg1, Iteration<? extends E,? extends X> arg2, boolean distinct)
arg1 - An Iteration containing the first set of elements.arg2 - An Iteration containing the second set of elements.distinct - Flag indicating whether duplicate elements should be filtered from
the result.protected boolean accept(E object) throws X extends Exception
protected void handleClose()
throws X extends Exception
IterationWrapperCloseableIteration.handleClose in class FilterIteration<E,X extends Exception>XX extends ExceptionCopyright © 2001-2013 Aduna. All Rights Reserved.