376 |
|
al.forEach(action); |
377 |
|
} |
378 |
|
|
379 |
+ |
/** |
380 |
+ |
* Returns a {@link Spliterator} over the elements in this set in the order |
381 |
+ |
* in which these elements were added. |
382 |
+ |
* |
383 |
+ |
* <p>The {@code Spliterator} reports {@link Spliterator#IMMUTABLE}, |
384 |
+ |
* {@link Spliterator#DISTINCT}, {@link Spliterator#SIZED}, and |
385 |
+ |
* {@link Spliterator#SUBSIZED}. |
386 |
+ |
* |
387 |
+ |
* <p>The spliterator provides a snapshot of the state of the set |
388 |
+ |
* when the spliterator was constructed. No synchronization is needed while |
389 |
+ |
* operating on the spliterator. The spliterator does <em>NOT</em> support |
390 |
+ |
* the {@code remove}, {@code set} or {@code add} methods. |
391 |
+ |
* |
392 |
+ |
* @return a {@code Spliterator} over the elements in this set |
393 |
+ |
* @since 1.8 |
394 |
+ |
*/ |
395 |
|
public Spliterator<E> spliterator() { |
396 |
|
return Spliterators.spliterator |
397 |
|
(al.getArray(), Spliterator.IMMUTABLE | Spliterator.DISTINCT); |