Here you can find the source of swapAll(final Object[] array)
public static void swapAll(final Object[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static void swapAll(final Object[] array) { Object tmp;//from w ww . j av a2 s .c o m for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final boolean[] array) { boolean tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final byte[] array) { byte tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final char[] array) { char tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final short[] array) { short tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final int[] array) { int tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final long[] array) { long tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final float[] array) { float tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final double[] array) { double tmp; for (int i = 0, j = array.length - 1; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final Object[] array, final int off, final int len) { final int last = off + len - 1; Object tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final boolean[] array, final int off, final int len) { final int last = off + len - 1; boolean tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final byte[] array, final int off, final int len) { final int last = off + len - 1; byte tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final char[] array, final int off, final int len) { final int last = off + len - 1; char tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final short[] array, final int off, final int len) { final int last = off + len - 1; short tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final int[] array, final int off, final int len) { final int last = off + len - 1; int tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final long[] array, final int off, final int len) { final int last = off + len - 1; long tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final float[] array, final int off, final int len) { final int last = off + len - 1; float tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } public static void swapAll(final double[] array, final int off, final int len) { final int last = off + len - 1; double tmp; for (int i = off, j = last; i < j; i++, j--) { tmp = array[i]; array[i] = array[j]; array[j] = tmp; } } }