Java Thread Callable max(final double[] a, final double[] b)

Here you can find the source of max(final double[] a, final double[] b)

Description

max

License

Open Source License

Declaration

public static Callable max(final double[] a, final double[] b) throws Exception 

Method Source Code


//package com.java2s;
import java.util.concurrent.*;

public class Main {
    public static Callable max(final double[] a, final double[] b) throws Exception {
        if (a.length != b.length)
            throw new Exception("");
        Callable c = new Callable() {
            public Object call() throws Exception {
                double[] result = new double[a.length];
                for (int i = 0; i < a.length; i++) {
                    result[i] = Math.max(a[i], b[i]);
                }/*w ww  .  j a  v a  2s .c om*/
                return result;
            }
        };
        return c;
    }
}

Related

  1. getBytes(final String string)
  2. getFuture(ExecutorService executorService, Callable callable)
  3. getRandomValueForPrimitive(Class type)
  4. invokeAll(Collection> tasks, ExecutorService executorService)
  5. invokeBulkActions(Collection> tasks)
  6. minScalar(final double[] a, final double scalar)
  7. powerTo(final double base, final double[] exponents)
  8. repeatedlyTry(Callable task, int maxRounds, long backoff)
  9. resolveCompositeKey(final String key, final Map props)