summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/data/GeneratingIterator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/bjc/data/GeneratingIterator.java')
-rw-r--r--src/main/java/bjc/data/GeneratingIterator.java27
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() {