Пример #1
0
 @Override
 public Spliterator<T> spliterator() {
   return Spliterators.spliterator(
       iterator(), length(), Spliterator.ORDERED | Spliterator.IMMUTABLE);
 }
Пример #2
0
 @Override
 default Spliterator<T> spliterator() {
   // the focus of the Stream API is on random-access collections of *known size*
   return Spliterators.spliterator(
       iterator(), length(), Spliterator.ORDERED | Spliterator.IMMUTABLE);
 }
 @Override
 public Spliterator.OfInt spliterator() {
   return Spliterators.spliteratorUnknownSize(iterator(), Spliterator.CONCURRENT);
 }