diff options
| author | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-08 22:39:59 -0300 |
|---|---|---|
| committer | Benjamin J. Culkin <bjculkin@mix.wvu.edu> | 2017-10-08 22:39:59 -0300 |
| commit | c82e3b3b2de0633317ec8fc85925e91422820597 (patch) | |
| tree | 96567416ce23c5ce85601f9cedc3a94bb1c55cba /BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java | |
| parent | b3ac1c8690c3e14c879913e5dcc03a5f5e14876e (diff) | |
Start splitting into maven modules
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java b/BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java deleted file mode 100644 index 50f28b1..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/data/TransformIterator.java +++ /dev/null @@ -1,46 +0,0 @@ -package bjc.utils.data; - -import java.util.Iterator; -import java.util.function.Function; - -/** - * An iterator that transforms values from one type to another. - * - * @author EVE - * - * @param <S> - * The source iterator type. - * - * @param <D> - * The destination iterator type. - */ -public class TransformIterator<S, D> implements Iterator<D> { - private final Iterator<S> source; - - private final Function<S, D> transform; - - /** - * Create a new transform iterator. - * - * @param source - * The source iterator to use. - * - * @param transform - * The transform to apply. - */ - public TransformIterator(final Iterator<S> source, final Function<S, D> transform) { - this.source = source; - this.transform = transform; - } - - @Override - public boolean hasNext() { - return source.hasNext(); - } - - @Override - public D next() { - return transform.apply(source.next()); - } - -} |
