List of utility methods to do Array Swap
void | swap(final Object[] array, final int i, final int j) swap final Object tmp = array[i];
array[i] = array[j];
array[j] = tmp;
|
void | swap(final Object[] array, int offset1, int offset2) Swaps two elements in the given array. if (array == null || array.length == 0) { return; swap(array, offset1, offset2, 1); |
void | swap(final Object[] array, int pos) swap swap(array, pos, pos + 1); |
void | swap(final Object[] data, final int i, final int j) Exchanges the elements at the two provided indices in the given array. final Object tmp = data[i];
data[i] = data[j];
data[j] = tmp;
|
void | swap(final Object[] values, final int firstPosition, final int secondPosition) swap final Object temporary = values[firstPosition];
values[firstPosition] = values[secondPosition];
values[secondPosition] = temporary;
|
void | swap(final String a[], final int i, final int j) Swaps two Strings. String T; T = a[i]; a[i] = a[j]; a[j] = T; |
void | swap(final T[] arr, final int i, final int j) Swaps two entries in a T array.
final T temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
|
void | swap(final T[] arr, final int i, final int j) Swaps two entries in a T array.
final T temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
|
void | swap(int arr[], int i, int j) Swap two positions. int a = arr[i];
arr[i] = arr[j];
arr[j] = a;
|
void | swap(int array[], int first, int last) swap the bytes of an integer array int i, k; for (i = first; i <= last; i++) { k = array[i]; array[i] = ((k >>> 24) & 0xff) | ((k >>> 8) & 0xff00) | ((k & 0xff) << 24) | ((k & 0xff00) << 8); |