From 278eed3e1f7cfef2d39a25aba53f4478c3ad8c58 Mon Sep 17 00:00:00 2001 From: Thomas Neidhart Date: Mon, 6 May 2013 19:12:25 +0000 Subject: [PATCH] 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 --- .../commons/collections4/IteratorUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index 284d261b0..62ad020ac 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -471,6 +471,22 @@ public class IteratorUtils { // Chained //----------------------------------------------------------------------- + + /** + * Gets an iterator that iterates through two {@link Iterator}s + * one after another. + * + * @param 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 Iterator chainedIterator(final Iterator iterator1, + final Iterator iterator2) { + return new IteratorChain(iterator1, iterator2); + } + /** * Gets an iterator that iterates through an array of {@link Iterator}s * one after another.