Package com.complexible.common.collect
Class ArrayIterable<T>
java.lang.Object
com.complexible.common.collect.ArrayIterable<T>
- All Implemented Interfaces:
Iterable<T>
Adapter class for using an Array as an Iterable, particularly, for allowing parts of an array to be the iterable. Does not make a copy of the array, so changes to the array will affect the Iterable and Iterators created from it.
- Since:
- 2.0
- Version:
- 2.0
- Author:
- Michael Grove
-
Constructor Summary
ConstructorsConstructorDescriptionArrayIterable(T[] theArray) Create a new ArrayIteratorArrayIterable(T[] theArray, int theStart, int theEnd) Create a new ArrayIterator -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ArrayIterable
Create a new ArrayIterator- Parameters:
theArray- the array to iterate over
-
ArrayIterable
Create a new ArrayIterator- Parameters:
theArray- the array to iterate overtheStart- the starting position of the arraytheEnd- the end position of the array
-
-
Method Details