Java Array Join join(T[] first, T[] second)

Here you can find the source of join(T[] first, T[] second)

Description

join

License

Open Source License

Declaration

public static <T> T[] join(T[] first, T[] second) 

Method Source Code

//package com.java2s;
/******************************************************************************************
 * COPYRIGHT:                                                                             *
 * Universitat Politecnica de Valencia 2013                                               *
 * Camino de Vera, s/n                                                                    *
 * 46022 Valencia, Spain                                                                  *
 * www.upv.es                                                                             *
 *                                                                                        * 
 * D I S C L A I M E R:                                                                   *
 * This software has been developed by the Universitat Politecnica de Valencia (UPV)      *
 * in the context of the european funded FITTEST project (contract number ICT257574)      *
 * of which the UPV is the coordinator. As the sole developer of this source code,        *
 * following the signed FITTEST Consortium Agreement, the UPV should decide upon an       *
 * appropriate license under which the source code will be distributed after termination  *
 * of the project. Until this time, this code can be used by the partners of the          *
 * FITTEST project for executing the tasks that are outlined in the Description of Work   *
 * (DoW) that is annexed to the contract with the EU.                                     *
 *                                                                                        * 
 * Although it has already been decided that this code will be distributed under an open  *
 * source license, the exact license has not been decided upon and will be announced      *
 * before the end of the project. Beware of any restrictions regarding the use of this    *
 * work that might arise from the open source license it might fall under! It is the      *
 * UPV's intention to make this work accessible, free of any charge.                      *
 *****************************************************************************************/

import java.util.Arrays;

public class Main {
    public static <T> T[] join(T[] first, T[] second) {
        if (first == null)
            return second;
        if (second == null)
            return first;
        T[] result = Arrays.copyOf(first, first.length + second.length);
        System.arraycopy(second, 0, result, first.length, second.length);
        return result;
    }/*from   www. j a  v a 2 s.  c  o m*/
}

Related

  1. join(T[] array, String separator)
  2. join(T[] array, String separator)
  3. join(T[] array, String separator)
  4. join(T[] array, String separator)
  5. join(T[] array1, T[] array2)
  6. join(T[] objs, String splitString)
  7. joinArrays(T[] a, T[] b)
  8. joinAttributes(final String[] atts1, final String[] atts2)
  9. joinByComma(String[] values)