diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-12 13:13:42 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-12 13:13:42 -0400 |
| commit | 9052ed6da37af23ea82588d248f409e60a33c6cb (patch) | |
| tree | e816d2032e0a550754712bbae836cdb11383e291 /src/main/java/bjc/data/ArrayIterator.java | |
| parent | 13aec7074fb0583a72112376df7b8764b0823ce0 (diff) | |
Finish up extraction
This applies the changes that were necessary to complete the extraction
of these packages from bjc-utils
Diffstat (limited to 'src/main/java/bjc/data/ArrayIterator.java')
| -rw-r--r-- | src/main/java/bjc/data/ArrayIterator.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/bjc/data/ArrayIterator.java b/src/main/java/bjc/data/ArrayIterator.java index 7778b81..6037e34 100644 --- a/src/main/java/bjc/data/ArrayIterator.java +++ b/src/main/java/bjc/data/ArrayIterator.java @@ -4,12 +4,21 @@ import java.util.Iterator; /** * Represents an iterator over an array of values. * + * @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; + /** + * Create a new array iterator. + * + * @param elms + * The array that will be iterated over. + */ + @SafeVarargs public ArrayIterator(T... elms) { arr = elms; idx = 0; @@ -20,6 +29,7 @@ public class ArrayIterator<T> implements Iterator<T> { return idx < arr.length; } + @SuppressWarnings("unchecked") @Override public T next() { if (idx >= arr.length) return null; |
