/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
public void testSetArray() { Iterator iter1 = makeArrayIterator(testArray); int count1 = 0; while (iter1.hasNext()) { ++count1; iter1.next(); } assertEquals("the count should be right using the constructor", count1, testArray.length); ArrayIterator iter2 = makeArrayIterator(); iter2.setArray(testArray); int count2 = 0; while (iter2.hasNext()) { ++count2; iter2.next(); } assertEquals("the count should be right using setArray(Object)", count2, testArray.length); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }
/** * Returns the next element in the array. * * @return the next element in the array * @throws NoSuchElementException if all the elements in the array * have already been returned */ public Object next() { if (hasNext() == false) { throw new NoSuchElementException(); } return Array.get(array, index++); }