Here you can find the source of concat(boolean[] a, boolean[] b)
Parameter | Description |
---|---|
a | the first array |
b | the second array |
public static final boolean[] concat(boolean[] a, boolean[] b)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array//from w ww . ja v a 2s . c o m * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final boolean[] concat(boolean[] a, boolean[] b) { boolean[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final boolean[] concat(boolean[] a, boolean[] b, boolean[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final byte[] concat(byte[] a, byte[] b) { byte[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final byte[] concat(byte[] a, byte[] b, byte[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final short[] concat(short[] a, short[] b) { short[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final short[] concat(short[] a, short[] b, short[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final char[] concat(char[] a, char[] b) { char[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final char[] concat(char[] a, char[] b, char[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final int[] concat(int[] a, int[] b) { int[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final int[] concat(int[] a, int[] b, int[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final long[] concat(long[] a, long[] b) { long[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final long[] concat(long[] a, long[] b, long[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final float[] concat(float[] a, float[] b) { float[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final float[] concat(float[] a, float[] b, float[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final double[] concat(double[] a, double[] b) { double[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final double[] concat(double[] a, double[] b, double[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @return a new array containing a shallow copy of both arrays */ public static final <T> T[] concat(T[] a, T[] b) { T[] r = Arrays.copyOf(a, a.length + b.length); System.arraycopy(b, 0, r, a.length, b.length); return r; } /** Return an array containing a copy of array {@code a} and {@code b} * @param a the first array * @param b the second array * @param dst the destination array to store the copied elements in * @param dstOff the offset into {@code dst} at which to append array {@code a} and {@code b} * @return a new array containing a shallow copy of both arrays */ public static final <T> T[] concat(T[] a, T[] b, T[] dst, int dstOff) { System.arraycopy(a, 0, dst, dstOff, a.length); System.arraycopy(b, 0, dst, dstOff + a.length, b.length); return dst; } }