985 |
|
} |
986 |
|
|
987 |
|
public E next() { |
988 |
< |
try { |
989 |
< |
return (E)(snapshot[cursor++]); |
990 |
< |
} catch (IndexOutOfBoundsException ex) { |
988 |
> |
if (! hasNext()) |
989 |
|
throw new NoSuchElementException(); |
990 |
< |
} |
990 |
> |
return (E) snapshot[cursor++]; |
991 |
|
} |
992 |
|
|
993 |
|
public E previous() { |
994 |
< |
try { |
997 |
< |
return (E)(snapshot[--cursor]); |
998 |
< |
} catch (IndexOutOfBoundsException e) { |
994 |
> |
if (! hasPrevious()) |
995 |
|
throw new NoSuchElementException(); |
996 |
< |
} |
996 |
> |
return (E) snapshot[--cursor]; |
997 |
|
} |
998 |
|
|
999 |
|
public int nextIndex() { |