1109 |
|
public void add(E e) { |
1110 |
|
throw new UnsupportedOperationException(); |
1111 |
|
} |
1112 |
+ |
|
1113 |
+ |
@Override |
1114 |
+ |
@SuppressWarnings("unchecked") |
1115 |
+ |
public void forEachRemaining(Consumer<? super E> action) { |
1116 |
+ |
Objects.requireNonNull(action); |
1117 |
+ |
final int size = snapshot.length; |
1118 |
+ |
for (int i = cursor; i < size; i++) { |
1119 |
+ |
action.accept((E) snapshot[i]); |
1120 |
+ |
} |
1121 |
+ |
cursor = size; |
1122 |
+ |
} |
1123 |
|
} |
1124 |
|
|
1125 |
|
/** |
1513 |
|
public void add(E e) { |
1514 |
|
throw new UnsupportedOperationException(); |
1515 |
|
} |
1516 |
+ |
|
1517 |
+ |
@Override |
1518 |
+ |
@SuppressWarnings("unchecked") |
1519 |
+ |
public void forEachRemaining(Consumer<? super E> action) { |
1520 |
+ |
Objects.requireNonNull(action); |
1521 |
+ |
while (nextIndex() < size) { |
1522 |
+ |
action.accept(it.next()); |
1523 |
+ |
} |
1524 |
+ |
} |
1525 |
|
} |
1526 |
|
|
1527 |
|
// Support for resetting lock while deserializing |