예제 #1
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);
 }
예제 #2
0
 @Override
 public Spliterator<T> spliterator() {
   return Spliterators.spliterator(
       iterator(), length(), Spliterator.ORDERED | Spliterator.IMMUTABLE);
 }