From d4ca769e542b2489b1e23cfcbdc3a0b7275b87cd Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Mon, 13 Apr 2020 18:40:41 -0400 Subject: Cleanup pass Cleanup pass to uniformize things --- .../java/bjc/utils/funcutils/IteratorUtils.java | 52 ++++++++++++---------- 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'base/src/main/java/bjc/utils/funcutils/IteratorUtils.java') diff --git a/base/src/main/java/bjc/utils/funcutils/IteratorUtils.java b/base/src/main/java/bjc/utils/funcutils/IteratorUtils.java index 2b5fc57..a97e876 100644 --- a/base/src/main/java/bjc/utils/funcutils/IteratorUtils.java +++ b/base/src/main/java/bjc/utils/funcutils/IteratorUtils.java @@ -7,20 +7,21 @@ import bjc.data.ArrayIterator; /** * Utility methods for dealing with iterators. - * + * * @author bjculkin * */ public class IteratorUtils { /** * A chain iterator. This is essentially flatMap in iterator form. + * * @author bjculkin * - * @param - * The type of the input values. - * - * @param - * The type of the output values. + * @param + * The type of the input values. + * + * @param + * The type of the output values. */ public static class ChainIterator implements Iterator { private Iterator mainItr; @@ -30,23 +31,25 @@ public class IteratorUtils { /** * Create a new chain iterator. - * + * * @param mainItr - * The main iterator for input. - * + * The main iterator for input. + * * @param trans - * The transformation to use to produce the outputs. + * The transformation to use to produce the outputs. */ public ChainIterator(Iterator mainItr, Function> trans) { this.mainItr = mainItr; - this.trans = trans; + this.trans = trans; } @Override public boolean hasNext() { if (curItr != null) { - if (curItr.hasNext()) return true; - else return mainItr.hasNext(); + if (curItr.hasNext()) + return true; + else + return mainItr.hasNext(); } return mainItr.hasNext(); @@ -64,9 +67,9 @@ public class IteratorUtils { /** * Convert an iterator to an iterable. - * + * * @param itr - * The iterator to convert. + * The iterator to convert. * * @return An iterable that gives back that iterator. */ @@ -76,9 +79,9 @@ public class IteratorUtils { /** * Convert an iterable to an iterator. - * + * * @param itr - * The iterable to convert. + * The iterable to convert. * * @return The iterator from that iterable */ @@ -90,7 +93,7 @@ public class IteratorUtils { * Convert an array to an iterator. * * @param parms - * The array to iterate over. + * The array to iterate over. * * @return An iterator over the provided array. */ @@ -101,16 +104,17 @@ public class IteratorUtils { /** * Create a chain iterator. - * + * * @param itrA - * The iterator for input values. - * + * The iterator for input values. + * * @param itrB - * The transformation for output values. - * + * The transformation for output values. + * * @return A chain iterator from the provided values. */ - public static Iterator chain(Iterator itrA, Function> itrB) { + public static Iterator chain(Iterator itrA, + Function> itrB) { return new ChainIterator<>(itrA, itrB); } } -- cgit v1.2.3