diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:43:13 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:43:13 -0400 |
| commit | f51f6da7319787348c38b875652b5c0e9f88c8aa (patch) | |
| tree | 943888fc724da2d2dedd89abec99dcbfcc089fd0 /src/main/java/bjc/data/GeneratingIterator.java | |
| parent | 9052ed6da37af23ea82588d248f409e60a33c6cb (diff) | |
Cleanup pass
Pass to do some cleanups
Diffstat (limited to 'src/main/java/bjc/data/GeneratingIterator.java')
| -rw-r--r-- | src/main/java/bjc/data/GeneratingIterator.java | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/main/java/bjc/data/GeneratingIterator.java b/src/main/java/bjc/data/GeneratingIterator.java index 9adda6f..ffa92cf 100644 --- a/src/main/java/bjc/data/GeneratingIterator.java +++ b/src/main/java/bjc/data/GeneratingIterator.java @@ -6,11 +6,11 @@ import java.util.function.UnaryOperator; /** * An iterator that generates a series of elements from a single element. - * + * * @author bjculkin * * @param <E> - * The type of element generated. + * The type of element generated. */ public class GeneratingIterator<E> implements Iterator<E> { /* Our current state. */ @@ -22,18 +22,19 @@ public class GeneratingIterator<E> implements Iterator<E> { /** * Create a new generative iterator. - * + * * @param initial - * The initial state of the generator. - * + * The initial state of the generator. + * * @param transition - * The function to apply to the state. - * + * The function to apply to the state. + * * @param stopper - * The predicate applied to the current state to determine when - * to stop. + * The predicate applied to the current state to determine + * when to stop. */ - public GeneratingIterator(E initial, UnaryOperator<E> transition, Predicate<E> stopper) { + public GeneratingIterator(E initial, UnaryOperator<E> transition, + Predicate<E> stopper) { state = initial; transtion = transition; stpper = stopper; @@ -47,9 +48,9 @@ public class GeneratingIterator<E> implements Iterator<E> { /* * @NOTE * - * As this currently is, it only works correctly assuming that next() is - * only called when hasNext() is true. Should we safeguard against - * people who are not doing the right thing? + * As this currently is, it only works correctly assuming that next() is only + * called when hasNext() is true. Should we safeguard against people who are not + * doing the right thing? */ @Override public E next() { |
