MCPcopy
hub / github.com/google/guava / concat

Method concat

guava/src/com/google/common/collect/ObjectArrays.java:78–85  ·  view source on GitHub ↗

Returns a new array that contains the concatenated contents of two arrays. @param first the first array of elements to concatenate @param second the second array of elements to concatenate @param type the component type of the returned array

(
      T[] first, T[] second, Class<@NonNull T> type)

Source from the content-addressed store, hash-verified

76 * @param type the component type of the returned array
77 */
78 @GwtIncompatible // Array.newInstance(Class, int)
79 public static <T extends @Nullable Object> T[] concat(
80 T[] first, T[] second, Class<@NonNull T> type) {
81 T[] result = newArray(type, first.length + second.length);
82 arraycopy(first, 0, result, 0, first.length);
83 arraycopy(second, 0, result, first.length, second.length);
84 return result;
85 }
86
87 /**
88 * Returns a new array that prepends {@code element} to {@code array}.

Callers 15

throwCauseMethod · 0.95
testConcatEmptyEmptyMethod · 0.95
testConcatBasicMethod · 0.95
testPrependOneElementMethod · 0.95
testAppendOneElementMethod · 0.95
testAppendTwoElementsMethod · 0.95

Calls 2

newArrayMethod · 0.95
copyOfMethod · 0.45

Tested by 15

testConcatEmptyEmptyMethod · 0.76
testConcatBasicMethod · 0.76
testPrependOneElementMethod · 0.76
testAppendOneElementMethod · 0.76
testAppendTwoElementsMethod · 0.76
newTestFileSystemMethod · 0.76