427 |
|
/** |
428 |
|
* Returns an iterator over all the elements (both expired and |
429 |
|
* unexpired) in this queue. The iterator does not |
430 |
< |
* return the elements in any particular order. |
430 |
> |
* return the elements in any particular order. |
431 |
|
* |
432 |
|
* @return an iterator over the elements in this queue |
433 |
|
*/ |
442 |
|
final Object[] array; // Array of all elements |
443 |
|
int cursor; // index of next element to return; |
444 |
|
int lastRet; // index of last element, or -1 if no such |
445 |
< |
|
445 |
> |
|
446 |
|
Itr(Object[] array) { |
447 |
|
lastRet = -1; |
448 |
|
this.array = array; |
460 |
|
} |
461 |
|
|
462 |
|
public void remove() { |
463 |
< |
if (lastRet < 0) |
463 |
> |
if (lastRet < 0) |
464 |
|
throw new IllegalStateException(); |
465 |
|
Object x = array[lastRet]; |
466 |
|
lastRet = -1; |