Here you can find the source of array2dcopy(final String[][] src, final String[][] target)
Parameter | Description |
---|---|
src | a parameter |
target | a parameter |
public static void array2dcopy(final String[][] src, final String[][] target)
//package com.java2s; /**/*from www .j av a 2s .c o m*/ * Copyright (c) 2011, Marc R?ttig, Stephan Aiche. * * This file is part of GenericKnimeNodes. * * GenericKnimeNodes is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ public class Main { /** * Copies the content of to_copy into target. Assumes that src and target * have the same size. * * @param src * @param target */ public static void array2dcopy(final String[][] src, final String[][] target) { assert (target.length == src.length); for (int i = 0; i < target.length; ++i) { int array_length = src[i].length; target[i] = new String[src[i].length]; System.arraycopy(src[i], 0, target[i], 0, array_length); } } }