Java Collections - Arrays.parallelSetAll() Examples |
|
||||||
Code Snippets Java Collections Java Java API Class:Methods:These methods set all elements of the specified array, in parallel, using the provided generator function to compute each element. public static <T> void parallelSetAll(T[] array, IntFunction<? extends T> generator) public static void parallelSetAll(int[] array, IntUnaryOperator generator) public static void parallelSetAll(long[] array, IntToLongFunction generator) public static void parallelSetAll(double[] array, IntToDoubleFunction generator) Examples
![]() package com.logicbig.example.arrays; Output[1, 3, 5, 7, 9, 11, 13, 15, 17, 19] Generator are executed in parallel, number of threads= available processor cores (8 on my machine): ![]() package com.logicbig.example.arrays; Output16:22:41.916
![]() package com.logicbig.example.arrays; Output[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |
|
||||||
|
|||||||
|