Java Array Join join(String[] a, String[] b)

Here you can find the source of join(String[] a, String[] b)

Description

join

License

Apache License

Declaration

private static String[] join(String[] a, String[] b) 

Method Source Code

//package com.java2s;
/*//from  w  w w  .  j  a v a  2  s  . co m
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.util.Arrays;

public class Main {
    private static String[] join(String[] a, String[] b) {
        String[] temp = new String[a.length + b.length];
        System.arraycopy(a, 0, temp, 0, a.length);
        System.arraycopy(b, 0, temp, a.length, b.length);

        Arrays.sort(temp); // necessary for binary searches in filterAttributes()

        return temp;
    }
}

Related

  1. join(String sep, String[] arr)
  2. join(String separator, String... array)
  3. join(String separator, String[] strings)
  4. join(String separator, String[] strings)
  5. join(String[] a, String delimiter, Integer startIndex)
  6. join(String[] a1, String[] a2)
  7. join(String[] ar, String sep)
  8. join(String[] args)
  9. join(String[] args, String delimiter)