From f51f6da7319787348c38b875652b5c0e9f88c8aa Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Mon, 13 Apr 2020 18:43:13 -0400 Subject: Cleanup pass Pass to do some cleanups --- src/main/java/bjc/data/GeneratingIterator.java | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/main/java/bjc/data/GeneratingIterator.java') 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 - * The type of element generated. + * The type of element generated. */ public class GeneratingIterator implements Iterator { /* Our current state. */ @@ -22,18 +22,19 @@ public class GeneratingIterator implements Iterator { /** * 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 transition, Predicate stopper) { + public GeneratingIterator(E initial, UnaryOperator transition, + Predicate stopper) { state = initial; transtion = transition; stpper = stopper; @@ -47,9 +48,9 @@ public class GeneratingIterator implements Iterator { /* * @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() { -- cgit v1.2.3