Java List Zip zip(List a, List b)

Here you can find the source of zip(List a, List b)

Description

zip

License

Open Source License

Declaration

public static List<Double> zip(List<Double> a, List<Double> b) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<Double> zip(List<Double> a, List<Double> b) {
        List<Double> out = new ArrayList<Double>();
        for (int i = 0; i < Math.min(a.size(), b.size()); i++)
            out.add(a.get(i) * b.get(i));
        return out;
    }// w w w .  java  2  s .  c  o m
}

Related

  1. zip(final List l1, final List l2)
  2. zip(List> lists)
  3. zip(List> lists)
  4. zipDoubleArray(List lists)
  5. zipper(List> listOfLists)