MCPcopy Create free account
hub / github.com/apache/commons-lang / add

Method add

src/main/java/org/apache/commons/lang3/ArrayUtils.java:240–244  ·  view source on GitHub ↗

Copies the given array and adds the given element at the end of the new array. The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array. If the input array is {@cod

(final boolean[] array, final boolean element)

Source from the content-addressed store, hash-verified

238 * @since 2.1
239 */
240 public static boolean[] add(final boolean[] array, final boolean element) {
241 final boolean[] newArray = (boolean[]) copyArrayGrow1(array, Boolean.TYPE);
242 newArray[newArray.length - 1] = element;
243 return newArray;
244 }
245
246 /**
247 * Inserts the specified element at the specified position in the array.

Calls 9

copyArrayGrow1Method · 0.95
arraycopyMethod · 0.95
getComponentTypeMethod · 0.95
getClassMethod · 0.95
valueOfMethod · 0.80
getLengthMethod · 0.80
newInstanceMethod · 0.45
setMethod · 0.45
getClassMethod · 0.45