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

Method swap

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

Swaps two elements in the given boolean array. There is no special handling for multi-dimensional arrays. This method does nothing for a null or empty input array or for overflow indices. Negative indices are promoted to 0(zero). Examples: ArrayUtils.swap([1, 2, 3], 0,

(final boolean[] array, final int offset1, final int offset2)

Source from the content-addressed store, hash-verified

8394 * @since 3.5
8395 */
8396 public static void swap(final boolean[] array, final int offset1, final int offset2) {
8397 swap(array, offset1, offset2, 1);
8398 }
8399
8400 /**
8401 * Swaps a series of elements in the given boolean array.

Callers 15

testSwapBooleanMethod · 0.95
testSwapBooleanRangeMethod · 0.95
testSwapByteMethod · 0.95
testSwapByteRangeMethod · 0.95
testSwapCharMethod · 0.95
testSwapCharRangeMethod · 0.95
testSwapDoubleMethod · 0.95
testSwapDoubleRangeMethod · 0.95

Calls 3

isEmptyMethod · 0.95
max0Method · 0.95
minMethod · 0.45

Tested by 15

testSwapBooleanMethod · 0.76
testSwapBooleanRangeMethod · 0.76
testSwapByteMethod · 0.76
testSwapByteRangeMethod · 0.76
testSwapCharMethod · 0.76
testSwapCharRangeMethod · 0.76
testSwapDoubleMethod · 0.76
testSwapDoubleRangeMethod · 0.76