| Type | Name and description |
|---|---|
static groovy.lang.Tuple2<K, T> |
findFirstCommonItem(java.util.Iterator<T> refIterator, java.util.Map<K, java.util.Iterator<T>> otherIterators)Finds the first item on an iterator that also appears on any of a number of other iterators. |
static groovy.lang.Tuple2<K, T> |
findFirstCommonItem(java.lang.Iterable<T> ref, java.util.Map<K, ? extends java.lang.Iterable<T>> others)Finds the first item in a collection that also appears in any of a number of other collections. |
static T |
findFirstCommonItem(java.util.Iterator<T> refIterator, java.util.Iterator<T> otherIterator)Finds the first item in an iterator that also appears in another iterator. |
static T |
findFirstCommonItem(java.lang.Iterable<T> ref, java.lang.Iterable<T> other)Finds the first item in a collection that also appears in another collection. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Finds the first item on an iterator that also appears on any of a number of other iterators.
This could have easily been implemented by Set logic, but the iterators may represent possibly quite long sequences, so we don't want to consume more items than necessary.
The iterators that are passed in will be (partly) consumed by this method, so the caller should not make any assumptions about their state when the method returns.
otherIterators that contained the match;null if refIterator is disjoint with all otherIterators.refIterator - the iterator with the reference items to look forotherIterators - a map containing a number of other iterators as values. The map keys
may be used to identify from which iterator the matching item came.Finds the first item in a collection that also appears in any of a number of other collections.
otherIterators that contained the match;null if ref is disjoint with all others.ref - the collection containing the reference itemsothers - a java.util.Map containing a number of other collections as values. The map keys
may be used to identify from which collection the matching item cameFinds the first item in an iterator that also appears in another iterator.
null if the two iterators are disjointref - the iterator returning the reference itemsothers - the iterator to compare withFinds the first item in a collection that also appears in another collection.
null if the two collections are disjointref - the collection containing the reference itemsothers - the collection to compare with