Here you can find the source of ConcatenateInt(List
Parameter | Description |
---|---|
arrays | List of arrays. |
public static int[] ConcatenateInt(List<int[]> arrays)
//package com.java2s; // under the BSD license. The original license terms are given below: import java.util.List; public class Main { /**//from w ww . java 2 s.c o m * Concatenate all the arrays in the list into a vector. * @param arrays List of arrays. * @return Vector. */ public static int[] ConcatenateInt(List<int[]> arrays) { int size = 0; for (int i = 0; i < arrays.size(); i++) { size += arrays.get(i).length; } int[] all = new int[size]; int idx = 0; for (int i = 0; i < arrays.size(); i++) { int[] v = arrays.get(i); for (int j = 0; j < v.length; j++) { all[idx++] = v[i]; } } return all; } }