Java Array Merge concat(double[] merged, double[] is)

Here you can find the source of concat(double[] merged, double[] is)

Description

Concatenates two double arrays.

License

Open Source License

Parameter

Parameter Description
merged the first array.
is the second array.

Return

the concatanated array.

Declaration

public static double[] concat(double[] merged, double[] is) 

Method Source Code

//package com.java2s;
/*//ww w  .  j  av  a 2  s  .  c o  m
 * This file is part of simple-cbir.
 *
 *  simple-cbir is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  simple-cbir 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with simple-cbir.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  Diese Datei ist Teil von simple-cbir.
 *
 *  simple-cbir ist Freie Software: Sie k?nnen es unter den Bedingungen
 *  der GNU General Public License, wie von der Free Software Foundation,
 *  Version 3 der Lizenz oder (nach Ihrer Wahl) jeder sp?teren
 *  ver?ffentlichten Version, weiterverbreiten und/oder modifizieren.
 *
 *  simple-cbir wird in der Hoffnung, dass es n?tzlich sein wird, aber
 *  OHNE JEDE GEW?HELEISTUNG, bereitgestellt; sogar ohne die implizite
 *  Gew?hrleistung der MARKTF?HIGKEIT oder EIGNUNG F?R EINEN BESTIMMTEN ZWECK.
 *  Siehe die GNU General Public License f?r weitere Details.
 *
 *  Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
 *  Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
 */

import java.util.Arrays;

public class Main {
    /**
     * Concatenates two double arrays.
     * 
     * @param merged
     *            the first array.
     * @param is
     *            the second array.
     * @return the concatanated array.
     */
    public static double[] concat(double[] merged, double[] is) {
        double result[] = new double[merged.length + is.length];
        result = Arrays.copyOf(merged, merged.length + is.length);
        System.arraycopy(is, 0, result, merged.length, is.length);
        return result;
    }
}

Related

  1. arrayMerge16bit(byte[] sourceArray, int sourceStart, byte[] destinationArray, int destinationStart, int length)
  2. merge( final Item[] values, final Item[] auxiliary, final int first, final int middle, final int last)
  3. merge(byte[] a, byte[] b)
  4. merge(byte[] array1, byte[] array2)
  5. merge(byte[] signature, byte[] message)