提交 e02f15e3 编写于 作者: P psandoz

8015792: Rename Spliterators.spliteratorFromIterator to Spliterators.iterator

Reviewed-by: chegar
上级 206c4375
......@@ -663,7 +663,7 @@ public final class Spliterators {
* @return An iterator
* @throws NullPointerException if the given spliterator is {@code null}
*/
public static<T> Iterator<T> iteratorFromSpliterator(Spliterator<? extends T> spliterator) {
public static<T> Iterator<T> iterator(Spliterator<? extends T> spliterator) {
Objects.requireNonNull(spliterator);
class Adapter implements Iterator<T>, Consumer<T> {
boolean valueReady = false;
......@@ -708,7 +708,7 @@ public final class Spliterators {
* @return An iterator
* @throws NullPointerException if the given spliterator is {@code null}
*/
public static PrimitiveIterator.OfInt iteratorFromSpliterator(Spliterator.OfInt spliterator) {
public static PrimitiveIterator.OfInt iterator(Spliterator.OfInt spliterator) {
Objects.requireNonNull(spliterator);
class Adapter implements PrimitiveIterator.OfInt, IntConsumer {
boolean valueReady = false;
......@@ -753,7 +753,7 @@ public final class Spliterators {
* @return An iterator
* @throws NullPointerException if the given spliterator is {@code null}
*/
public static PrimitiveIterator.OfLong iteratorFromSpliterator(Spliterator.OfLong spliterator) {
public static PrimitiveIterator.OfLong iterator(Spliterator.OfLong spliterator) {
Objects.requireNonNull(spliterator);
class Adapter implements PrimitiveIterator.OfLong, LongConsumer {
boolean valueReady = false;
......@@ -798,7 +798,7 @@ public final class Spliterators {
* @return An iterator
* @throws NullPointerException if the given spliterator is {@code null}
*/
public static PrimitiveIterator.OfDouble iteratorFromSpliterator(Spliterator.OfDouble spliterator) {
public static PrimitiveIterator.OfDouble iterator(Spliterator.OfDouble spliterator) {
Objects.requireNonNull(spliterator);
class Adapter implements PrimitiveIterator.OfDouble, DoubleConsumer {
boolean valueReady = false;
......
......@@ -168,7 +168,7 @@ abstract class DoublePipeline<E_IN>
@Override
public final PrimitiveIterator.OfDouble iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......
......@@ -172,7 +172,7 @@ abstract class IntPipeline<E_IN>
@Override
public final PrimitiveIterator.OfInt iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......
......@@ -169,7 +169,7 @@ abstract class LongPipeline<E_IN>
@Override
public final PrimitiveIterator.OfLong iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......
......@@ -137,7 +137,7 @@ abstract class ReferencePipeline<P_IN, P_OUT>
@Override
public final Iterator<P_OUT> iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
......
......@@ -227,7 +227,7 @@ class SpinedBuffer<E>
@Override
public Iterator<E> iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......@@ -712,7 +712,7 @@ class SpinedBuffer<E>
@Override
public PrimitiveIterator.OfInt iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
public Spliterator.OfInt spliterator() {
......@@ -815,7 +815,7 @@ class SpinedBuffer<E>
@Override
public PrimitiveIterator.OfLong iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
......@@ -919,7 +919,7 @@ class SpinedBuffer<E>
@Override
public PrimitiveIterator.OfDouble iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
public Spliterator.OfDouble spliterator() {
......
......@@ -170,7 +170,7 @@ public class SpliteratorTraversingAndSplittingTest {
() -> Spliterators.spliteratorUnknownSize(exp.iterator(), 0));
db.add("Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Spliterator ), ...)",
() -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(exp.spliterator()), exp.size(), 0));
() -> Spliterators.spliterator(Spliterators.iterator(exp.spliterator()), exp.size(), 0));
db.add("Spliterators.spliterator(T[], ...)",
() -> Spliterators.spliterator(exp.toArray(new Integer[0]), 0));
......@@ -549,10 +549,10 @@ public class SpliteratorTraversingAndSplittingTest {
() -> Arrays.spliterator(exp));
db.add("Spliterators.spliterator(PrimitiveIterator.OfInt, ...)",
() -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
() -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfInt, ...)",
() -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
() -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
class IntSpliteratorFromArray extends Spliterators.AbstractIntSpliterator {
int[] a;
......@@ -702,10 +702,10 @@ public class SpliteratorTraversingAndSplittingTest {
() -> Arrays.spliterator(exp));
db.add("Spliterators.spliterator(PrimitiveIterator.OfLong, ...)",
() -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
() -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfLong, ...)",
() -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
() -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
class LongSpliteratorFromArray extends Spliterators.AbstractLongSpliterator {
long[] a;
......@@ -862,10 +862,10 @@ public class SpliteratorTraversingAndSplittingTest {
() -> Arrays.spliterator(exp));
db.add("Spliterators.spliterator(PrimitiveIterator.OfDouble, ...)",
() -> Spliterators.spliterator(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), exp.length, 0));
() -> Spliterators.spliterator(Spliterators.iterator(Arrays.spliterator(exp)), exp.length, 0));
db.add("Spliterators.spliteratorUnknownSize(PrimitiveIterator.OfDouble, ...)",
() -> Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(exp)), 0));
() -> Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(exp)), 0));
class DoubleSpliteratorFromArray extends Spliterators.AbstractDoubleSpliterator {
double[] a;
......
......@@ -45,7 +45,7 @@ public interface TestData<T, S extends BaseStream<T, S>>
@Override
default Iterator<T> iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
Spliterator<T> spliterator();
......@@ -292,7 +292,7 @@ public interface TestData<T, S extends BaseStream<T, S>>
@Override
public PrimitiveIterator.OfInt iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......@@ -317,7 +317,7 @@ public interface TestData<T, S extends BaseStream<T, S>>
@Override
public PrimitiveIterator.OfLong iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......@@ -342,7 +342,7 @@ public interface TestData<T, S extends BaseStream<T, S>>
@Override
public PrimitiveIterator.OfDouble iterator() {
return Spliterators.iteratorFromSpliterator(spliterator());
return Spliterators.iterator(spliterator());
}
@Override
......
......@@ -48,7 +48,7 @@ public class DoubleNodeTest extends OpTestCase {
List<Node<Double>> nodes = new ArrayList<>();
nodes.add(Nodes.node(array));
nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
nodes.add(tree(toList(array), l -> Nodes.node(toDoubleArray(l))));
nodes.add(fill(array, Nodes.doubleBuilder(array.length)));
nodes.add(fill(array, Nodes.doubleBuilder()));
......
......@@ -48,7 +48,7 @@ public class IntNodeTest extends OpTestCase {
List<Node<Integer>> nodes = new ArrayList<>();
nodes.add(Nodes.node(array));
nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
nodes.add(tree(toList(array), l -> Nodes.node(toIntArray(l))));
nodes.add(fill(array, Nodes.intBuilder(array.length)));
nodes.add(fill(array, Nodes.intBuilder()));
......
......@@ -48,7 +48,7 @@ public class LongNodeTest extends OpTestCase {
List<Node<Long>> nodes = new ArrayList<>();
nodes.add(Nodes.node(array));
nodes.add(degenerateTree(Spliterators.iteratorFromSpliterator(Arrays.spliterator(array))));
nodes.add(degenerateTree(Spliterators.iterator(Arrays.spliterator(array))));
nodes.add(tree(toList(array), l -> Nodes.node(toLongArray(l))));
nodes.add(fill(array, Nodes.longBuilder(array.length)));
nodes.add(fill(array, Nodes.longBuilder()));
......
......@@ -150,7 +150,7 @@ public class SortedOpTest extends OpTestCase {
}
private IntStream unknownSizeIntStream(int[] a) {
return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
return StreamSupport.intStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
}
@Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class)
......@@ -193,7 +193,7 @@ public class SortedOpTest extends OpTestCase {
}
private LongStream unknownSizeLongStream(long[] a) {
return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
return StreamSupport.longStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
}
@Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class)
......@@ -236,7 +236,7 @@ public class SortedOpTest extends OpTestCase {
}
private DoubleStream unknownSizeDoubleStream(double[] a) {
return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iteratorFromSpliterator(Arrays.spliterator(a)), 0));
return StreamSupport.doubleStream(Spliterators.spliteratorUnknownSize(Spliterators.iterator(Arrays.spliterator(a)), 0));
}
@Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册