1089 |
|
return new COWIterator<E>(elements, index); |
1090 |
|
} |
1091 |
|
|
1092 |
+ |
/** |
1093 |
+ |
* Returns a {@link Spliterator} over the elements in this list. |
1094 |
+ |
* |
1095 |
+ |
* <p>The {@code Spliterator} reports {@link Spliterator#IMMUTABLE}, |
1096 |
+ |
* {@link Spliterator#ORDERED}, {@link Spliterator#SIZED}, and |
1097 |
+ |
* {@link Spliterator#SUBSIZED}. |
1098 |
+ |
* |
1099 |
+ |
* <p>The spliterator provides a snapshot of the state of the list |
1100 |
+ |
* when the spliterator was constructed. No synchronization is needed while |
1101 |
+ |
* operating on the spliterator. The spliterator does <em>NOT</em> support |
1102 |
+ |
* the {@code remove}, {@code set} or {@code add} methods. |
1103 |
+ |
* |
1104 |
+ |
* @return a {@code Spliterator} over the elements in this list |
1105 |
+ |
* @since 1.8 |
1106 |
+ |
*/ |
1107 |
|
public Spliterator<E> spliterator() { |
1108 |
|
return Spliterators.spliterator |
1109 |
|
(getArray(), Spliterator.IMMUTABLE | Spliterator.ORDERED); |