503 |
|
*/ |
504 |
|
private class Itr implements Iterator<E> { |
505 |
|
final Object[] array; // Array of all elements |
506 |
< |
int cursor; // index of next element to return; |
507 |
< |
int lastRet; // index of last element, or -1 if no such |
506 |
> |
int cursor; // index of next element to return; |
507 |
> |
int lastRet; // index of last element, or -1 if no such |
508 |
|
|
509 |
|
Itr(Object[] array) { |
510 |
|
lastRet = -1; |
524 |
|
|
525 |
|
public void remove() { |
526 |
|
if (lastRet < 0) |
527 |
< |
throw new IllegalStateException(); |
527 |
> |
throw new IllegalStateException(); |
528 |
|
Object x = array[lastRet]; |
529 |
|
lastRet = -1; |
530 |
|
// Traverse underlying queue to find == element, |