Class Parallel


  • public class Parallel
    extends java.lang.Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  Parallel.Operation<T>  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.concurrent.ExecutorService pool  
      static int threads  
    • Constructor Summary

      Constructors 
      Constructor Description
      Parallel()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> void forEach​(T[] elements, Parallel.Operation<T> operation)
      Performs a specific foreach loop over an array.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • pool

        public static java.util.concurrent.ExecutorService pool
      • threads

        public static int threads
    • Constructor Detail

      • Parallel

        public Parallel()
    • Method Detail

      • forEach

        public static <T> void forEach​(T[] elements,
                                       Parallel.Operation<T> operation)
        Performs a specific foreach loop over an array.
        Parameters:
        elements - The input array to loop over.
        operation - The operation to perform on each element of the array.