From e6abd726d36133bfdfddcce1ee1701f3bdad8536 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 25 Oct 2007 17:10:50 +0000 Subject: [PATCH] doc updates. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5449 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/util/AdaptedIterator.java | 8 ++++++++ core/src/main/java/hudson/util/Iterators.java | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/core/src/main/java/hudson/util/AdaptedIterator.java b/core/src/main/java/hudson/util/AdaptedIterator.java index 16e2b7f74a..c8bd3079e8 100644 --- a/core/src/main/java/hudson/util/AdaptedIterator.java +++ b/core/src/main/java/hudson/util/AdaptedIterator.java @@ -5,8 +5,12 @@ import java.util.Iterator; /** * {@link Iterator} that adapts the values returned from another iterator. * + *

+ * This class should be really in {@link Iterators} but for historical reasons it's here. + * * @author Kohsuke Kawaguchi * @since 1.121 + * @see Iterators */ public abstract class AdaptedIterator implements Iterator { private final Iterator core; @@ -15,6 +19,10 @@ public abstract class AdaptedIterator implements Iterator { this.core = core; } + protected AdaptedIterator(Iterable core) { + this(core.iterator()); + } + public boolean hasNext() { return core.hasNext(); } diff --git a/core/src/main/java/hudson/util/Iterators.java b/core/src/main/java/hudson/util/Iterators.java index da5f9c3892..3f3b107581 100644 --- a/core/src/main/java/hudson/util/Iterators.java +++ b/core/src/main/java/hudson/util/Iterators.java @@ -11,6 +11,7 @@ import java.util.AbstractList; * Varios {@link Iterator} implementations. * * @author Kohsuke Kawaguchi + * @see AdaptedIterator */ public class Iterators { /** @@ -59,6 +60,8 @@ public class Iterators { /** * Creates a filtered view of another iterator. + * + * @since 1.150 */ public static abstract class FilterIterator implements Iterator { private final Iterator core; @@ -111,6 +114,8 @@ public class Iterators { /** * Returns the {@link Iterable} that lists items in the reverse order. + * + * @since 1.150 */ public static Iterable reverse(final List lst) { return new Iterable() { @@ -137,6 +142,8 @@ public class Iterators { * Returns a list that represents [start,end). * * For example sequence(1,5,1)={1,2,3,4}, and sequence(7,1,-2)={7.5,3} + * + * @since 1.150 */ public static List sequence(final int start, int end, final int step) { @@ -162,6 +169,8 @@ public class Iterators { /** * The short cut for {@code reverse(sequence(start,end,step))}. + * + * @since 1.150 */ public static List reverseSequence(int start, int end, int step) { return sequence(end-1,start-1,-step);