OpenJDK / lambda / lambda / jdk
changeset 7803:b6a9eaeb0f16
Should be static methods.
author | psandoz |
---|---|
date | Wed, 03 Apr 2013 09:48:39 +0200 |
parents | 3a341b419f9b |
children | 7a7f3b25d409 |
files | src/share/classes/java/util/Arrays.java |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/java/util/Arrays.java Tue Apr 02 23:29:12 2013 -0700 +++ b/src/share/classes/java/util/Arrays.java Wed Apr 03 09:48:39 2013 +0200 @@ -4467,7 +4467,7 @@ * value for that position * @param <T> Type of elements of the array */ - public<T> void setAll(T[] array, IntFunction<? extends T> generator) { + public static<T> void setAll(T[] array, IntFunction<? extends T> generator) { for (int i=0; i<array.length; i++) array[i] = generator.apply(i); } @@ -4481,7 +4481,7 @@ * value for that position * @param <T> Type of elements of the array */ - public<T> void parallelSetAll(T[] array, IntFunction<? extends T> generator) { + public static<T> void parallelSetAll(T[] array, IntFunction<? extends T> generator) { Streams.intRange(0, array.length).parallel().forEach(i -> { array[i] = generator.apply(i); }); } @@ -4493,7 +4493,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public void setAll(int[] array, IntUnaryOperator generator) { + public static void setAll(int[] array, IntUnaryOperator generator) { for (int i=0; i<array.length; i++) array[i] = generator.applyAsInt(i); } @@ -4506,7 +4506,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public<T> void parallelSetAll(int[] array, IntUnaryOperator generator) { + public static void parallelSetAll(int[] array, IntUnaryOperator generator) { Streams.intRange(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsInt(i); }); } @@ -4518,7 +4518,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public void setAll(long[] array, IntToLongFunction generator) { + public static void setAll(long[] array, IntToLongFunction generator) { for (int i=0; i<array.length; i++) array[i] = generator.applyAsLong(i); } @@ -4531,7 +4531,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public<T> void parallelSetAll(long[] array, IntToLongFunction generator) { + public static void parallelSetAll(long[] array, IntToLongFunction generator) { Streams.intRange(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsLong(i); }); } @@ -4543,7 +4543,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public void setAll(double[] array, IntToDoubleFunction generator) { + public static void setAll(double[] array, IntToDoubleFunction generator) { for (int i=0; i<array.length; i++) array[i] = generator.applyAsDouble(i); } @@ -4556,7 +4556,7 @@ * @param generator Function accepting an index and producing the desired * value for that position */ - public<T> void parallelSetAll(double[] array, IntToDoubleFunction generator) { + public static void parallelSetAll(double[] array, IntToDoubleFunction generator) { Streams.intRange(0, array.length).parallel().forEach(i -> { array[i] = generator.applyAsDouble(i); }); }