summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/data/ArrayIterator.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2020-04-13 18:43:13 -0400
committerBen Culkin <scorpress@gmail.com>2020-04-13 18:43:13 -0400
commitf51f6da7319787348c38b875652b5c0e9f88c8aa (patch)
tree943888fc724da2d2dedd89abec99dcbfcc089fd0 /src/main/java/bjc/data/ArrayIterator.java
parent9052ed6da37af23ea82588d248f409e60a33c6cb (diff)
Cleanup pass
Pass to do some cleanups
Diffstat (limited to 'src/main/java/bjc/data/ArrayIterator.java')
-rw-r--r--src/main/java/bjc/data/ArrayIterator.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/bjc/data/ArrayIterator.java b/src/main/java/bjc/data/ArrayIterator.java
index 6037e34..6d11a1d 100644
--- a/src/main/java/bjc/data/ArrayIterator.java
+++ b/src/main/java/bjc/data/ArrayIterator.java
@@ -1,22 +1,24 @@
package bjc.data;
import java.util.Iterator;
+
/**
* Represents an iterator over an array of values.
*
- * @param <T> The type of values in the array.
- *
+ * @param <T>
+ * The type of values in the array.
+ *
* @author Ben Culkin
*/
public class ArrayIterator<T> implements Iterator<T> {
private Object[] arr;
- private int idx;
+ private int idx;
/**
* Create a new array iterator.
*
* @param elms
- * The array that will be iterated over.
+ * The array that will be iterated over.
*/
@SafeVarargs
public ArrayIterator(T... elms) {
@@ -32,8 +34,9 @@ public class ArrayIterator<T> implements Iterator<T> {
@SuppressWarnings("unchecked")
@Override
public T next() {
- if (idx >= arr.length) return null;
+ if (idx >= arr.length)
+ return null;
- return (T)(arr[idx++]);
+ return (T) (arr[idx++]);
}
}