public void setArray(E[] array) {
        if (this.array != null) {
            throw new IllegalStateException("The array to iterate over has already been set");
        }
        this.array = array;
        this.startIndex = 0;
        this.endIndex = array.length;
        this.index = 0;
    }
Sets the array that the  should iterate over.
<p/>
This method may only be called once, otherwise an IllegalStateException
will occur.
<p/>
The {@link #reset} method can be used to reset the iterator if required.

@param array the array that the iterator should iterate over
@throws IllegalStateException if the <code>array</code> was set in the constructor
@throws NullPointerException  if <code>array</code> is <code>null</code>
jphp-runtime/src/php/runtime/common/collections/iterators/ObjectArrayIterator.java