Add again chainedIterator method with 2 iterators to avoid generics warning in client code.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1479682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-05-06 19:12:25 +00:00
parent fbb81a37f8
commit 278eed3e1f
1 changed files with 16 additions and 0 deletions

View File

@ -471,6 +471,22 @@ public class IteratorUtils {
// Chained
//-----------------------------------------------------------------------
/**
* Gets an iterator that iterates through two {@link Iterator}s
* one after another.
*
* @param <E> the element type
* @param iterator1 the first iterator to use, not null
* @param iterator2 the second iterator to use, not null
* @return a combination iterator over the iterators
* @throws NullPointerException if either iterator is null
*/
public static <E> Iterator<E> chainedIterator(final Iterator<? extends E> iterator1,
final Iterator<? extends E> iterator2) {
return new IteratorChain<E>(iterator1, iterator2);
}
/**
* Gets an iterator that iterates through an array of {@link Iterator}s
* one after another.