commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r949864 [6/48] - in /websites/production/commons/content/proper/commons-lang: ./ apidocs/ apidocs/org/apache/commons/lang3/ apidocs/org/apache/commons/lang3/builder/ apidocs/org/apache/commons/lang3/time/ apidocs/src-html/org/apache/commons...
Date Fri, 01 May 2015 20:55:53 GMT
Modified: websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/ArrayUtils.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/ArrayUtils.html (original)
+++ websites/production/commons/content/proper/commons-lang/apidocs/src-html/org/apache/commons/lang3/ArrayUtils.html Fri May  1 20:55:51 2015
@@ -1855,4750 +1855,5919 @@
 <span class="sourceLineNo">1847</span>        }<a name="line.1847"></a>
 <span class="sourceLineNo">1848</span>    }<a name="line.1848"></a>
 <span class="sourceLineNo">1849</span><a name="line.1849"></a>
-<span class="sourceLineNo">1850</span>    // IndexOf search<a name="line.1850"></a>
-<span class="sourceLineNo">1851</span>    // ----------------------------------------------------------------------<a name="line.1851"></a>
-<span class="sourceLineNo">1852</span><a name="line.1852"></a>
-<span class="sourceLineNo">1853</span>    // Object IndexOf<a name="line.1853"></a>
-<span class="sourceLineNo">1854</span>    //-----------------------------------------------------------------------<a name="line.1854"></a>
-<span class="sourceLineNo">1855</span>    /**<a name="line.1855"></a>
-<span class="sourceLineNo">1856</span>     * &lt;p&gt;Finds the index of the given object in the array.&lt;/p&gt;<a name="line.1856"></a>
-<span class="sourceLineNo">1857</span>     *<a name="line.1857"></a>
-<span class="sourceLineNo">1858</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1858"></a>
-<span class="sourceLineNo">1859</span>     *<a name="line.1859"></a>
-<span class="sourceLineNo">1860</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.1860"></a>
-<span class="sourceLineNo">1861</span>     * @param objectToFind  the object to find, may be {@code null}<a name="line.1861"></a>
-<span class="sourceLineNo">1862</span>     * @return the index of the object within the array,<a name="line.1862"></a>
-<span class="sourceLineNo">1863</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.1863"></a>
-<span class="sourceLineNo">1864</span>     */<a name="line.1864"></a>
-<span class="sourceLineNo">1865</span>    public static int indexOf(final Object[] array, final Object objectToFind) {<a name="line.1865"></a>
-<span class="sourceLineNo">1866</span>        return indexOf(array, objectToFind, 0);<a name="line.1866"></a>
-<span class="sourceLineNo">1867</span>    }<a name="line.1867"></a>
-<span class="sourceLineNo">1868</span><a name="line.1868"></a>
-<span class="sourceLineNo">1869</span>    /**<a name="line.1869"></a>
-<span class="sourceLineNo">1870</span>     * &lt;p&gt;Finds the index of the given object in the array starting at the given index.&lt;/p&gt;<a name="line.1870"></a>
-<span class="sourceLineNo">1871</span>     *<a name="line.1871"></a>
-<span class="sourceLineNo">1872</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1872"></a>
-<span class="sourceLineNo">1873</span>     *<a name="line.1873"></a>
-<span class="sourceLineNo">1874</span>     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array<a name="line.1874"></a>
-<span class="sourceLineNo">1875</span>     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;<a name="line.1875"></a>
-<span class="sourceLineNo">1876</span>     *<a name="line.1876"></a>
-<span class="sourceLineNo">1877</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.1877"></a>
-<span class="sourceLineNo">1878</span>     * @param objectToFind  the object to find, may be {@code null}<a name="line.1878"></a>
-<span class="sourceLineNo">1879</span>     * @param startIndex  the index to start searching at<a name="line.1879"></a>
-<span class="sourceLineNo">1880</span>     * @return the index of the object within the array starting at the index,<a name="line.1880"></a>
-<span class="sourceLineNo">1881</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.1881"></a>
-<span class="sourceLineNo">1882</span>     */<a name="line.1882"></a>
-<span class="sourceLineNo">1883</span>    public static int indexOf(final Object[] array, final Object objectToFind, int startIndex) {<a name="line.1883"></a>
-<span class="sourceLineNo">1884</span>        if (array == null) {<a name="line.1884"></a>
-<span class="sourceLineNo">1885</span>            return INDEX_NOT_FOUND;<a name="line.1885"></a>
-<span class="sourceLineNo">1886</span>        }<a name="line.1886"></a>
-<span class="sourceLineNo">1887</span>        if (startIndex &lt; 0) {<a name="line.1887"></a>
-<span class="sourceLineNo">1888</span>            startIndex = 0;<a name="line.1888"></a>
-<span class="sourceLineNo">1889</span>        }<a name="line.1889"></a>
-<span class="sourceLineNo">1890</span>        if (objectToFind == null) {<a name="line.1890"></a>
-<span class="sourceLineNo">1891</span>            for (int i = startIndex; i &lt; array.length; i++) {<a name="line.1891"></a>
-<span class="sourceLineNo">1892</span>                if (array[i] == null) {<a name="line.1892"></a>
-<span class="sourceLineNo">1893</span>                    return i;<a name="line.1893"></a>
-<span class="sourceLineNo">1894</span>                }<a name="line.1894"></a>
-<span class="sourceLineNo">1895</span>            }<a name="line.1895"></a>
-<span class="sourceLineNo">1896</span>        } else if (array.getClass().getComponentType().isInstance(objectToFind)) {<a name="line.1896"></a>
-<span class="sourceLineNo">1897</span>            for (int i = startIndex; i &lt; array.length; i++) {<a name="line.1897"></a>
-<span class="sourceLineNo">1898</span>                if (objectToFind.equals(array[i])) {<a name="line.1898"></a>
-<span class="sourceLineNo">1899</span>                    return i;<a name="line.1899"></a>
-<span class="sourceLineNo">1900</span>                }<a name="line.1900"></a>
-<span class="sourceLineNo">1901</span>            }<a name="line.1901"></a>
+<span class="sourceLineNo">1850</span>    // Swap<a name="line.1850"></a>
+<span class="sourceLineNo">1851</span>    //-----------------------------------------------------------------------<a name="line.1851"></a>
+<span class="sourceLineNo">1852</span>    /**<a name="line.1852"></a>
+<span class="sourceLineNo">1853</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1853"></a>
+<span class="sourceLineNo">1854</span>     *<a name="line.1854"></a>
+<span class="sourceLineNo">1855</span>     * &lt;p&gt;There is no special handling for multi-dimensional arrays.&lt;/p&gt;<a name="line.1855"></a>
+<span class="sourceLineNo">1856</span>     *<a name="line.1856"></a>
+<span class="sourceLineNo">1857</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1857"></a>
+<span class="sourceLineNo">1858</span>     * <a name="line.1858"></a>
+<span class="sourceLineNo">1859</span>     * &lt;p&gt;Examples:<a name="line.1859"></a>
+<span class="sourceLineNo">1860</span>     *     &lt;ul&gt;<a name="line.1860"></a>
+<span class="sourceLineNo">1861</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 2) -&gt; ["3", "2", "1"]&lt;/li&gt;<a name="line.1861"></a>
+<span class="sourceLineNo">1862</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 0) -&gt; ["1", "2", "3"]&lt;/li&gt;<a name="line.1862"></a>
+<span class="sourceLineNo">1863</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 1, 0) -&gt; ["2", "1", "3"]&lt;/li&gt;<a name="line.1863"></a>
+<span class="sourceLineNo">1864</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1864"></a>
+<span class="sourceLineNo">1865</span>     *     &lt;/ul&gt;<a name="line.1865"></a>
+<span class="sourceLineNo">1866</span>     * &lt;/p&gt;<a name="line.1866"></a>
+<span class="sourceLineNo">1867</span>     *<a name="line.1867"></a>
+<span class="sourceLineNo">1868</span>     * @param array the array to swap, may be {@code null}<a name="line.1868"></a>
+<span class="sourceLineNo">1869</span>     * @param offset1 the index of the first element to swap<a name="line.1869"></a>
+<span class="sourceLineNo">1870</span>     * @param offset2 the index of the second element to swap<a name="line.1870"></a>
+<span class="sourceLineNo">1871</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.1871"></a>
+<span class="sourceLineNo">1872</span>     */<a name="line.1872"></a>
+<span class="sourceLineNo">1873</span>    public static void swap(final Object[] array, int offset1, int offset2) {<a name="line.1873"></a>
+<span class="sourceLineNo">1874</span>        if (array == null) {<a name="line.1874"></a>
+<span class="sourceLineNo">1875</span>            return;<a name="line.1875"></a>
+<span class="sourceLineNo">1876</span>        }<a name="line.1876"></a>
+<span class="sourceLineNo">1877</span>        swap(array, offset1, offset2, 1);<a name="line.1877"></a>
+<span class="sourceLineNo">1878</span>    }<a name="line.1878"></a>
+<span class="sourceLineNo">1879</span><a name="line.1879"></a>
+<span class="sourceLineNo">1880</span>    /**<a name="line.1880"></a>
+<span class="sourceLineNo">1881</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1881"></a>
+<span class="sourceLineNo">1882</span>     *<a name="line.1882"></a>
+<span class="sourceLineNo">1883</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1883"></a>
+<span class="sourceLineNo">1884</span>     *<a name="line.1884"></a>
+<span class="sourceLineNo">1885</span>     * &lt;p&gt;Examples:<a name="line.1885"></a>
+<span class="sourceLineNo">1886</span>     *     &lt;ul&gt;<a name="line.1886"></a>
+<span class="sourceLineNo">1887</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 2) -&gt; [true, false, true]&lt;/li&gt;<a name="line.1887"></a>
+<span class="sourceLineNo">1888</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 0) -&gt; [true, false, true]&lt;/li&gt;<a name="line.1888"></a>
+<span class="sourceLineNo">1889</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 1, 0) -&gt; [false, true, true]&lt;/li&gt;<a name="line.1889"></a>
+<span class="sourceLineNo">1890</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1890"></a>
+<span class="sourceLineNo">1891</span>     *     &lt;/ul&gt;<a name="line.1891"></a>
+<span class="sourceLineNo">1892</span>     * &lt;/p&gt;<a name="line.1892"></a>
+<span class="sourceLineNo">1893</span>     * <a name="line.1893"></a>
+<span class="sourceLineNo">1894</span>     * @param array  the array to swap, may be {@code null}<a name="line.1894"></a>
+<span class="sourceLineNo">1895</span>     * @param offset1 the index of the first element to swap<a name="line.1895"></a>
+<span class="sourceLineNo">1896</span>     * @param offset2 the index of the second element to swap<a name="line.1896"></a>
+<span class="sourceLineNo">1897</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.1897"></a>
+<span class="sourceLineNo">1898</span>     */<a name="line.1898"></a>
+<span class="sourceLineNo">1899</span>    public static void swap(final long[] array, int offset1, int offset2) {<a name="line.1899"></a>
+<span class="sourceLineNo">1900</span>        if (array == null) {<a name="line.1900"></a>
+<span class="sourceLineNo">1901</span>            return;<a name="line.1901"></a>
 <span class="sourceLineNo">1902</span>        }<a name="line.1902"></a>
-<span class="sourceLineNo">1903</span>        return INDEX_NOT_FOUND;<a name="line.1903"></a>
+<span class="sourceLineNo">1903</span>        swap(array, offset1, offset2, 1);<a name="line.1903"></a>
 <span class="sourceLineNo">1904</span>    }<a name="line.1904"></a>
 <span class="sourceLineNo">1905</span><a name="line.1905"></a>
 <span class="sourceLineNo">1906</span>    /**<a name="line.1906"></a>
-<span class="sourceLineNo">1907</span>     * &lt;p&gt;Finds the last index of the given object within the array.&lt;/p&gt;<a name="line.1907"></a>
+<span class="sourceLineNo">1907</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1907"></a>
 <span class="sourceLineNo">1908</span>     *<a name="line.1908"></a>
-<span class="sourceLineNo">1909</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1909"></a>
+<span class="sourceLineNo">1909</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1909"></a>
 <span class="sourceLineNo">1910</span>     *<a name="line.1910"></a>
-<span class="sourceLineNo">1911</span>     * @param array  the array to travers backwords looking for the object, may be {@code null}<a name="line.1911"></a>
-<span class="sourceLineNo">1912</span>     * @param objectToFind  the object to find, may be {@code null}<a name="line.1912"></a>
-<span class="sourceLineNo">1913</span>     * @return the last index of the object within the array,<a name="line.1913"></a>
-<span class="sourceLineNo">1914</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.1914"></a>
-<span class="sourceLineNo">1915</span>     */<a name="line.1915"></a>
-<span class="sourceLineNo">1916</span>    public static int lastIndexOf(final Object[] array, final Object objectToFind) {<a name="line.1916"></a>
-<span class="sourceLineNo">1917</span>        return lastIndexOf(array, objectToFind, Integer.MAX_VALUE);<a name="line.1917"></a>
-<span class="sourceLineNo">1918</span>    }<a name="line.1918"></a>
-<span class="sourceLineNo">1919</span><a name="line.1919"></a>
-<span class="sourceLineNo">1920</span>    /**<a name="line.1920"></a>
-<span class="sourceLineNo">1921</span>     * &lt;p&gt;Finds the last index of the given object in the array starting at the given index.&lt;/p&gt;<a name="line.1921"></a>
-<span class="sourceLineNo">1922</span>     *<a name="line.1922"></a>
-<span class="sourceLineNo">1923</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1923"></a>
-<span class="sourceLineNo">1924</span>     *<a name="line.1924"></a>
-<span class="sourceLineNo">1925</span>     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than<a name="line.1925"></a>
-<span class="sourceLineNo">1926</span>     * the array length will search from the end of the array.&lt;/p&gt;<a name="line.1926"></a>
-<span class="sourceLineNo">1927</span>     *<a name="line.1927"></a>
-<span class="sourceLineNo">1928</span>     * @param array  the array to traverse for looking for the object, may be {@code null}<a name="line.1928"></a>
-<span class="sourceLineNo">1929</span>     * @param objectToFind  the object to find, may be {@code null}<a name="line.1929"></a>
-<span class="sourceLineNo">1930</span>     * @param startIndex  the start index to travers backwards from<a name="line.1930"></a>
-<span class="sourceLineNo">1931</span>     * @return the last index of the object within the array,<a name="line.1931"></a>
-<span class="sourceLineNo">1932</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.1932"></a>
-<span class="sourceLineNo">1933</span>     */<a name="line.1933"></a>
-<span class="sourceLineNo">1934</span>    public static int lastIndexOf(final Object[] array, final Object objectToFind, int startIndex) {<a name="line.1934"></a>
-<span class="sourceLineNo">1935</span>        if (array == null) {<a name="line.1935"></a>
-<span class="sourceLineNo">1936</span>            return INDEX_NOT_FOUND;<a name="line.1936"></a>
-<span class="sourceLineNo">1937</span>        }<a name="line.1937"></a>
-<span class="sourceLineNo">1938</span>        if (startIndex &lt; 0) {<a name="line.1938"></a>
-<span class="sourceLineNo">1939</span>            return INDEX_NOT_FOUND;<a name="line.1939"></a>
-<span class="sourceLineNo">1940</span>        } else if (startIndex &gt;= array.length) {<a name="line.1940"></a>
-<span class="sourceLineNo">1941</span>            startIndex = array.length - 1;<a name="line.1941"></a>
-<span class="sourceLineNo">1942</span>        }<a name="line.1942"></a>
-<span class="sourceLineNo">1943</span>        if (objectToFind == null) {<a name="line.1943"></a>
-<span class="sourceLineNo">1944</span>            for (int i = startIndex; i &gt;= 0; i--) {<a name="line.1944"></a>
-<span class="sourceLineNo">1945</span>                if (array[i] == null) {<a name="line.1945"></a>
-<span class="sourceLineNo">1946</span>                    return i;<a name="line.1946"></a>
-<span class="sourceLineNo">1947</span>                }<a name="line.1947"></a>
-<span class="sourceLineNo">1948</span>            }<a name="line.1948"></a>
-<span class="sourceLineNo">1949</span>        } else if (array.getClass().getComponentType().isInstance(objectToFind)) {<a name="line.1949"></a>
-<span class="sourceLineNo">1950</span>            for (int i = startIndex; i &gt;= 0; i--) {<a name="line.1950"></a>
-<span class="sourceLineNo">1951</span>                if (objectToFind.equals(array[i])) {<a name="line.1951"></a>
-<span class="sourceLineNo">1952</span>                    return i;<a name="line.1952"></a>
-<span class="sourceLineNo">1953</span>                }<a name="line.1953"></a>
-<span class="sourceLineNo">1954</span>            }<a name="line.1954"></a>
-<span class="sourceLineNo">1955</span>        }<a name="line.1955"></a>
-<span class="sourceLineNo">1956</span>        return INDEX_NOT_FOUND;<a name="line.1956"></a>
-<span class="sourceLineNo">1957</span>    }<a name="line.1957"></a>
-<span class="sourceLineNo">1958</span><a name="line.1958"></a>
-<span class="sourceLineNo">1959</span>    /**<a name="line.1959"></a>
-<span class="sourceLineNo">1960</span>     * &lt;p&gt;Checks if the object is in the given array.&lt;/p&gt;<a name="line.1960"></a>
-<span class="sourceLineNo">1961</span>     *<a name="line.1961"></a>
-<span class="sourceLineNo">1962</span>     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;<a name="line.1962"></a>
-<span class="sourceLineNo">1963</span>     *<a name="line.1963"></a>
-<span class="sourceLineNo">1964</span>     * @param array  the array to search through<a name="line.1964"></a>
-<span class="sourceLineNo">1965</span>     * @param objectToFind  the object to find<a name="line.1965"></a>
-<span class="sourceLineNo">1966</span>     * @return {@code true} if the array contains the object<a name="line.1966"></a>
-<span class="sourceLineNo">1967</span>     */<a name="line.1967"></a>
-<span class="sourceLineNo">1968</span>    public static boolean contains(final Object[] array, final Object objectToFind) {<a name="line.1968"></a>
-<span class="sourceLineNo">1969</span>        return indexOf(array, objectToFind) != INDEX_NOT_FOUND;<a name="line.1969"></a>
-<span class="sourceLineNo">1970</span>    }<a name="line.1970"></a>
-<span class="sourceLineNo">1971</span><a name="line.1971"></a>
-<span class="sourceLineNo">1972</span>    // long IndexOf<a name="line.1972"></a>
-<span class="sourceLineNo">1973</span>    //-----------------------------------------------------------------------<a name="line.1973"></a>
-<span class="sourceLineNo">1974</span>    /**<a name="line.1974"></a>
-<span class="sourceLineNo">1975</span>     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;<a name="line.1975"></a>
-<span class="sourceLineNo">1976</span>     *<a name="line.1976"></a>
-<span class="sourceLineNo">1977</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1977"></a>
-<span class="sourceLineNo">1978</span>     *<a name="line.1978"></a>
-<span class="sourceLineNo">1979</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.1979"></a>
-<span class="sourceLineNo">1980</span>     * @param valueToFind  the value to find<a name="line.1980"></a>
-<span class="sourceLineNo">1981</span>     * @return the index of the value within the array,<a name="line.1981"></a>
-<span class="sourceLineNo">1982</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.1982"></a>
-<span class="sourceLineNo">1983</span>     */<a name="line.1983"></a>
-<span class="sourceLineNo">1984</span>    public static int indexOf(final long[] array, final long valueToFind) {<a name="line.1984"></a>
-<span class="sourceLineNo">1985</span>        return indexOf(array, valueToFind, 0);<a name="line.1985"></a>
-<span class="sourceLineNo">1986</span>    }<a name="line.1986"></a>
-<span class="sourceLineNo">1987</span><a name="line.1987"></a>
-<span class="sourceLineNo">1988</span>    /**<a name="line.1988"></a>
-<span class="sourceLineNo">1989</span>     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.1989"></a>
-<span class="sourceLineNo">1990</span>     *<a name="line.1990"></a>
-<span class="sourceLineNo">1991</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.1991"></a>
-<span class="sourceLineNo">1992</span>     *<a name="line.1992"></a>
-<span class="sourceLineNo">1993</span>     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array<a name="line.1993"></a>
-<span class="sourceLineNo">1994</span>     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;<a name="line.1994"></a>
-<span class="sourceLineNo">1995</span>     *<a name="line.1995"></a>
-<span class="sourceLineNo">1996</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.1996"></a>
-<span class="sourceLineNo">1997</span>     * @param valueToFind  the value to find<a name="line.1997"></a>
-<span class="sourceLineNo">1998</span>     * @param startIndex  the index to start searching at<a name="line.1998"></a>
-<span class="sourceLineNo">1999</span>     * @return the index of the value within the array,<a name="line.1999"></a>
-<span class="sourceLineNo">2000</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2000"></a>
-<span class="sourceLineNo">2001</span>     */<a name="line.2001"></a>
-<span class="sourceLineNo">2002</span>    public static int indexOf(final long[] array, final long valueToFind, int startIndex) {<a name="line.2002"></a>
-<span class="sourceLineNo">2003</span>        if (array == null) {<a name="line.2003"></a>
-<span class="sourceLineNo">2004</span>            return INDEX_NOT_FOUND;<a name="line.2004"></a>
-<span class="sourceLineNo">2005</span>        }<a name="line.2005"></a>
-<span class="sourceLineNo">2006</span>        if (startIndex &lt; 0) {<a name="line.2006"></a>
-<span class="sourceLineNo">2007</span>            startIndex = 0;<a name="line.2007"></a>
-<span class="sourceLineNo">2008</span>        }<a name="line.2008"></a>
-<span class="sourceLineNo">2009</span>        for (int i = startIndex; i &lt; array.length; i++) {<a name="line.2009"></a>
-<span class="sourceLineNo">2010</span>            if (valueToFind == array[i]) {<a name="line.2010"></a>
-<span class="sourceLineNo">2011</span>                return i;<a name="line.2011"></a>
-<span class="sourceLineNo">2012</span>            }<a name="line.2012"></a>
-<span class="sourceLineNo">2013</span>        }<a name="line.2013"></a>
-<span class="sourceLineNo">2014</span>        return INDEX_NOT_FOUND;<a name="line.2014"></a>
-<span class="sourceLineNo">2015</span>    }<a name="line.2015"></a>
-<span class="sourceLineNo">2016</span><a name="line.2016"></a>
-<span class="sourceLineNo">2017</span>    /**<a name="line.2017"></a>
-<span class="sourceLineNo">2018</span>     * &lt;p&gt;Finds the last index of the given value within the array.&lt;/p&gt;<a name="line.2018"></a>
-<span class="sourceLineNo">2019</span>     *<a name="line.2019"></a>
-<span class="sourceLineNo">2020</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2020"></a>
-<span class="sourceLineNo">2021</span>     *<a name="line.2021"></a>
-<span class="sourceLineNo">2022</span>     * @param array  the array to travers backwords looking for the object, may be {@code null}<a name="line.2022"></a>
-<span class="sourceLineNo">2023</span>     * @param valueToFind  the object to find<a name="line.2023"></a>
-<span class="sourceLineNo">2024</span>     * @return the last index of the value within the array,<a name="line.2024"></a>
-<span class="sourceLineNo">2025</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2025"></a>
-<span class="sourceLineNo">2026</span>     */<a name="line.2026"></a>
-<span class="sourceLineNo">2027</span>    public static int lastIndexOf(final long[] array, final long valueToFind) {<a name="line.2027"></a>
-<span class="sourceLineNo">2028</span>        return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);<a name="line.2028"></a>
-<span class="sourceLineNo">2029</span>    }<a name="line.2029"></a>
-<span class="sourceLineNo">2030</span><a name="line.2030"></a>
-<span class="sourceLineNo">2031</span>    /**<a name="line.2031"></a>
-<span class="sourceLineNo">2032</span>     * &lt;p&gt;Finds the last index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2032"></a>
-<span class="sourceLineNo">2033</span>     *<a name="line.2033"></a>
-<span class="sourceLineNo">2034</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2034"></a>
-<span class="sourceLineNo">2035</span>     *<a name="line.2035"></a>
-<span class="sourceLineNo">2036</span>     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the<a name="line.2036"></a>
-<span class="sourceLineNo">2037</span>     * array length will search from the end of the array.&lt;/p&gt;<a name="line.2037"></a>
+<span class="sourceLineNo">1911</span>     * &lt;p&gt;Examples:<a name="line.1911"></a>
+<span class="sourceLineNo">1912</span>     *     &lt;ul&gt;<a name="line.1912"></a>
+<span class="sourceLineNo">1913</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.1913"></a>
+<span class="sourceLineNo">1914</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.1914"></a>
+<span class="sourceLineNo">1915</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.1915"></a>
+<span class="sourceLineNo">1916</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1916"></a>
+<span class="sourceLineNo">1917</span>     *     &lt;/ul&gt;<a name="line.1917"></a>
+<span class="sourceLineNo">1918</span>     * &lt;/p&gt;<a name="line.1918"></a>
+<span class="sourceLineNo">1919</span>     *<a name="line.1919"></a>
+<span class="sourceLineNo">1920</span>     * @param array  the array to swap, may be {@code null}<a name="line.1920"></a>
+<span class="sourceLineNo">1921</span>     * @param offset1 the index of the first element to swap<a name="line.1921"></a>
+<span class="sourceLineNo">1922</span>     * @param offset2 the index of the second element to swap<a name="line.1922"></a>
+<span class="sourceLineNo">1923</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.1923"></a>
+<span class="sourceLineNo">1924</span>     */<a name="line.1924"></a>
+<span class="sourceLineNo">1925</span>    public static void swap(final int[] array, int offset1, int offset2) {<a name="line.1925"></a>
+<span class="sourceLineNo">1926</span>        if (array == null) {<a name="line.1926"></a>
+<span class="sourceLineNo">1927</span>            return;<a name="line.1927"></a>
+<span class="sourceLineNo">1928</span>        }<a name="line.1928"></a>
+<span class="sourceLineNo">1929</span>        swap(array, offset1, offset2, 1);<a name="line.1929"></a>
+<span class="sourceLineNo">1930</span>    }<a name="line.1930"></a>
+<span class="sourceLineNo">1931</span><a name="line.1931"></a>
+<span class="sourceLineNo">1932</span>    /**<a name="line.1932"></a>
+<span class="sourceLineNo">1933</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1933"></a>
+<span class="sourceLineNo">1934</span>     *<a name="line.1934"></a>
+<span class="sourceLineNo">1935</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1935"></a>
+<span class="sourceLineNo">1936</span>     *<a name="line.1936"></a>
+<span class="sourceLineNo">1937</span>     * &lt;p&gt;Examples:<a name="line.1937"></a>
+<span class="sourceLineNo">1938</span>     *     &lt;ul&gt;<a name="line.1938"></a>
+<span class="sourceLineNo">1939</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.1939"></a>
+<span class="sourceLineNo">1940</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.1940"></a>
+<span class="sourceLineNo">1941</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.1941"></a>
+<span class="sourceLineNo">1942</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1942"></a>
+<span class="sourceLineNo">1943</span>     *     &lt;/ul&gt;<a name="line.1943"></a>
+<span class="sourceLineNo">1944</span>     * &lt;/p&gt;<a name="line.1944"></a>
+<span class="sourceLineNo">1945</span>     * <a name="line.1945"></a>
+<span class="sourceLineNo">1946</span>     * @param array  the array to swap, may be {@code null}<a name="line.1946"></a>
+<span class="sourceLineNo">1947</span>     * @param offset1 the index of the first element to swap<a name="line.1947"></a>
+<span class="sourceLineNo">1948</span>     * @param offset2 the index of the second element to swap<a name="line.1948"></a>
+<span class="sourceLineNo">1949</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.1949"></a>
+<span class="sourceLineNo">1950</span>     */<a name="line.1950"></a>
+<span class="sourceLineNo">1951</span>    public static void swap(final short[] array, int offset1, int offset2) {<a name="line.1951"></a>
+<span class="sourceLineNo">1952</span>        if (array == null) {<a name="line.1952"></a>
+<span class="sourceLineNo">1953</span>            return;<a name="line.1953"></a>
+<span class="sourceLineNo">1954</span>        }<a name="line.1954"></a>
+<span class="sourceLineNo">1955</span>        swap(array, offset1, offset2, 1);<a name="line.1955"></a>
+<span class="sourceLineNo">1956</span>    }<a name="line.1956"></a>
+<span class="sourceLineNo">1957</span><a name="line.1957"></a>
+<span class="sourceLineNo">1958</span>    /**<a name="line.1958"></a>
+<span class="sourceLineNo">1959</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1959"></a>
+<span class="sourceLineNo">1960</span>     *<a name="line.1960"></a>
+<span class="sourceLineNo">1961</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1961"></a>
+<span class="sourceLineNo">1962</span>     * <a name="line.1962"></a>
+<span class="sourceLineNo">1963</span>     * &lt;p&gt;Examples:<a name="line.1963"></a>
+<span class="sourceLineNo">1964</span>     *     &lt;ul&gt;<a name="line.1964"></a>
+<span class="sourceLineNo">1965</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.1965"></a>
+<span class="sourceLineNo">1966</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.1966"></a>
+<span class="sourceLineNo">1967</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.1967"></a>
+<span class="sourceLineNo">1968</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1968"></a>
+<span class="sourceLineNo">1969</span>     *     &lt;/ul&gt;<a name="line.1969"></a>
+<span class="sourceLineNo">1970</span>     * &lt;/p&gt;<a name="line.1970"></a>
+<span class="sourceLineNo">1971</span>     *<a name="line.1971"></a>
+<span class="sourceLineNo">1972</span>     * @param array  the array to swap, may be {@code null}<a name="line.1972"></a>
+<span class="sourceLineNo">1973</span>     * @param offset1 the index of the first element to swap<a name="line.1973"></a>
+<span class="sourceLineNo">1974</span>     * @param offset2 the index of the second element to swap<a name="line.1974"></a>
+<span class="sourceLineNo">1975</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.1975"></a>
+<span class="sourceLineNo">1976</span>     */<a name="line.1976"></a>
+<span class="sourceLineNo">1977</span>    public static void swap(final char[] array, int offset1, int offset2) {<a name="line.1977"></a>
+<span class="sourceLineNo">1978</span>        if (array == null) {<a name="line.1978"></a>
+<span class="sourceLineNo">1979</span>            return;<a name="line.1979"></a>
+<span class="sourceLineNo">1980</span>        }<a name="line.1980"></a>
+<span class="sourceLineNo">1981</span>        swap(array, offset1, offset2, 1);<a name="line.1981"></a>
+<span class="sourceLineNo">1982</span>    }<a name="line.1982"></a>
+<span class="sourceLineNo">1983</span><a name="line.1983"></a>
+<span class="sourceLineNo">1984</span>    /**<a name="line.1984"></a>
+<span class="sourceLineNo">1985</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.1985"></a>
+<span class="sourceLineNo">1986</span>     *<a name="line.1986"></a>
+<span class="sourceLineNo">1987</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.1987"></a>
+<span class="sourceLineNo">1988</span>     *<a name="line.1988"></a>
+<span class="sourceLineNo">1989</span>     * &lt;p&gt;Examples:<a name="line.1989"></a>
+<span class="sourceLineNo">1990</span>     *     &lt;ul&gt;<a name="line.1990"></a>
+<span class="sourceLineNo">1991</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.1991"></a>
+<span class="sourceLineNo">1992</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.1992"></a>
+<span class="sourceLineNo">1993</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.1993"></a>
+<span class="sourceLineNo">1994</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.1994"></a>
+<span class="sourceLineNo">1995</span>     *     &lt;/ul&gt;<a name="line.1995"></a>
+<span class="sourceLineNo">1996</span>     * &lt;/p&gt;<a name="line.1996"></a>
+<span class="sourceLineNo">1997</span>     * <a name="line.1997"></a>
+<span class="sourceLineNo">1998</span>     * @param array  the array to swap, may be {@code null}<a name="line.1998"></a>
+<span class="sourceLineNo">1999</span>     * @param offset1 the index of the first element to swap<a name="line.1999"></a>
+<span class="sourceLineNo">2000</span>     * @param offset2 the index of the second element to swap<a name="line.2000"></a>
+<span class="sourceLineNo">2001</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.2001"></a>
+<span class="sourceLineNo">2002</span>     */<a name="line.2002"></a>
+<span class="sourceLineNo">2003</span>    public static void swap(final byte[] array, int offset1, int offset2) {<a name="line.2003"></a>
+<span class="sourceLineNo">2004</span>        if (array == null) {<a name="line.2004"></a>
+<span class="sourceLineNo">2005</span>            return;<a name="line.2005"></a>
+<span class="sourceLineNo">2006</span>        }<a name="line.2006"></a>
+<span class="sourceLineNo">2007</span>        swap(array, offset1, offset2, 1);<a name="line.2007"></a>
+<span class="sourceLineNo">2008</span>    }<a name="line.2008"></a>
+<span class="sourceLineNo">2009</span><a name="line.2009"></a>
+<span class="sourceLineNo">2010</span>    /**<a name="line.2010"></a>
+<span class="sourceLineNo">2011</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.2011"></a>
+<span class="sourceLineNo">2012</span>     *<a name="line.2012"></a>
+<span class="sourceLineNo">2013</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2013"></a>
+<span class="sourceLineNo">2014</span>     *<a name="line.2014"></a>
+<span class="sourceLineNo">2015</span>     * &lt;p&gt;Examples:<a name="line.2015"></a>
+<span class="sourceLineNo">2016</span>     *     &lt;ul&gt;<a name="line.2016"></a>
+<span class="sourceLineNo">2017</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.2017"></a>
+<span class="sourceLineNo">2018</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.2018"></a>
+<span class="sourceLineNo">2019</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.2019"></a>
+<span class="sourceLineNo">2020</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2020"></a>
+<span class="sourceLineNo">2021</span>     *     &lt;/ul&gt;<a name="line.2021"></a>
+<span class="sourceLineNo">2022</span>     * &lt;/p&gt;<a name="line.2022"></a>
+<span class="sourceLineNo">2023</span>     * <a name="line.2023"></a>
+<span class="sourceLineNo">2024</span>     * @param array  the array to swap, may be {@code null}<a name="line.2024"></a>
+<span class="sourceLineNo">2025</span>     * @param offset1 the index of the first element to swap<a name="line.2025"></a>
+<span class="sourceLineNo">2026</span>     * @param offset2 the index of the second element to swap<a name="line.2026"></a>
+<span class="sourceLineNo">2027</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.2027"></a>
+<span class="sourceLineNo">2028</span>     */<a name="line.2028"></a>
+<span class="sourceLineNo">2029</span>    public static void swap(final double[] array, int offset1, int offset2) {<a name="line.2029"></a>
+<span class="sourceLineNo">2030</span>        if (array == null) {<a name="line.2030"></a>
+<span class="sourceLineNo">2031</span>            return;<a name="line.2031"></a>
+<span class="sourceLineNo">2032</span>        }<a name="line.2032"></a>
+<span class="sourceLineNo">2033</span>        swap(array, offset1, offset2, 1);<a name="line.2033"></a>
+<span class="sourceLineNo">2034</span>    }<a name="line.2034"></a>
+<span class="sourceLineNo">2035</span><a name="line.2035"></a>
+<span class="sourceLineNo">2036</span>    /**<a name="line.2036"></a>
+<span class="sourceLineNo">2037</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.2037"></a>
 <span class="sourceLineNo">2038</span>     *<a name="line.2038"></a>
-<span class="sourceLineNo">2039</span>     * @param array  the array to traverse for looking for the object, may be {@code null}<a name="line.2039"></a>
-<span class="sourceLineNo">2040</span>     * @param valueToFind  the value to find<a name="line.2040"></a>
-<span class="sourceLineNo">2041</span>     * @param startIndex  the start index to travers backwards from<a name="line.2041"></a>
-<span class="sourceLineNo">2042</span>     * @return the last index of the value within the array,<a name="line.2042"></a>
-<span class="sourceLineNo">2043</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2043"></a>
-<span class="sourceLineNo">2044</span>     */<a name="line.2044"></a>
-<span class="sourceLineNo">2045</span>    public static int lastIndexOf(final long[] array, final long valueToFind, int startIndex) {<a name="line.2045"></a>
-<span class="sourceLineNo">2046</span>        if (array == null) {<a name="line.2046"></a>
-<span class="sourceLineNo">2047</span>            return INDEX_NOT_FOUND;<a name="line.2047"></a>
-<span class="sourceLineNo">2048</span>        }<a name="line.2048"></a>
-<span class="sourceLineNo">2049</span>        if (startIndex &lt; 0) {<a name="line.2049"></a>
-<span class="sourceLineNo">2050</span>            return INDEX_NOT_FOUND;<a name="line.2050"></a>
-<span class="sourceLineNo">2051</span>        } else if (startIndex &gt;= array.length) {<a name="line.2051"></a>
-<span class="sourceLineNo">2052</span>            startIndex = array.length - 1;<a name="line.2052"></a>
-<span class="sourceLineNo">2053</span>        }<a name="line.2053"></a>
-<span class="sourceLineNo">2054</span>        for (int i = startIndex; i &gt;= 0; i--) {<a name="line.2054"></a>
-<span class="sourceLineNo">2055</span>            if (valueToFind == array[i]) {<a name="line.2055"></a>
-<span class="sourceLineNo">2056</span>                return i;<a name="line.2056"></a>
-<span class="sourceLineNo">2057</span>            }<a name="line.2057"></a>
+<span class="sourceLineNo">2039</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2039"></a>
+<span class="sourceLineNo">2040</span>     *<a name="line.2040"></a>
+<span class="sourceLineNo">2041</span>     * &lt;p&gt;Examples:<a name="line.2041"></a>
+<span class="sourceLineNo">2042</span>     *     &lt;ul&gt;<a name="line.2042"></a>
+<span class="sourceLineNo">2043</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.2043"></a>
+<span class="sourceLineNo">2044</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.2044"></a>
+<span class="sourceLineNo">2045</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.2045"></a>
+<span class="sourceLineNo">2046</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2046"></a>
+<span class="sourceLineNo">2047</span>     *     &lt;/ul&gt;<a name="line.2047"></a>
+<span class="sourceLineNo">2048</span>     * &lt;/p&gt;<a name="line.2048"></a>
+<span class="sourceLineNo">2049</span>     * <a name="line.2049"></a>
+<span class="sourceLineNo">2050</span>     * @param array  the array to swap, may be {@code null}<a name="line.2050"></a>
+<span class="sourceLineNo">2051</span>     * @param offset1 the index of the first element to swap<a name="line.2051"></a>
+<span class="sourceLineNo">2052</span>     * @param offset2 the index of the second element to swap<a name="line.2052"></a>
+<span class="sourceLineNo">2053</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.2053"></a>
+<span class="sourceLineNo">2054</span>     */<a name="line.2054"></a>
+<span class="sourceLineNo">2055</span>    public static void swap(final float[] array, int offset1, int offset2) {<a name="line.2055"></a>
+<span class="sourceLineNo">2056</span>        if (array == null) {<a name="line.2056"></a>
+<span class="sourceLineNo">2057</span>            return;<a name="line.2057"></a>
 <span class="sourceLineNo">2058</span>        }<a name="line.2058"></a>
-<span class="sourceLineNo">2059</span>        return INDEX_NOT_FOUND;<a name="line.2059"></a>
+<span class="sourceLineNo">2059</span>        swap(array, offset1, offset2, 1);<a name="line.2059"></a>
 <span class="sourceLineNo">2060</span>    }<a name="line.2060"></a>
 <span class="sourceLineNo">2061</span><a name="line.2061"></a>
 <span class="sourceLineNo">2062</span>    /**<a name="line.2062"></a>
-<span class="sourceLineNo">2063</span>     * &lt;p&gt;Checks if the value is in the given array.&lt;/p&gt;<a name="line.2063"></a>
+<span class="sourceLineNo">2063</span>     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;<a name="line.2063"></a>
 <span class="sourceLineNo">2064</span>     *<a name="line.2064"></a>
-<span class="sourceLineNo">2065</span>     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;<a name="line.2065"></a>
+<span class="sourceLineNo">2065</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2065"></a>
 <span class="sourceLineNo">2066</span>     *<a name="line.2066"></a>
-<span class="sourceLineNo">2067</span>     * @param array  the array to search through<a name="line.2067"></a>
-<span class="sourceLineNo">2068</span>     * @param valueToFind  the value to find<a name="line.2068"></a>
-<span class="sourceLineNo">2069</span>     * @return {@code true} if the array contains the object<a name="line.2069"></a>
-<span class="sourceLineNo">2070</span>     */<a name="line.2070"></a>
-<span class="sourceLineNo">2071</span>    public static boolean contains(final long[] array, final long valueToFind) {<a name="line.2071"></a>
-<span class="sourceLineNo">2072</span>        return indexOf(array, valueToFind) != INDEX_NOT_FOUND;<a name="line.2072"></a>
-<span class="sourceLineNo">2073</span>    }<a name="line.2073"></a>
-<span class="sourceLineNo">2074</span><a name="line.2074"></a>
-<span class="sourceLineNo">2075</span>    // int IndexOf<a name="line.2075"></a>
-<span class="sourceLineNo">2076</span>    //-----------------------------------------------------------------------<a name="line.2076"></a>
-<span class="sourceLineNo">2077</span>    /**<a name="line.2077"></a>
-<span class="sourceLineNo">2078</span>     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;<a name="line.2078"></a>
-<span class="sourceLineNo">2079</span>     *<a name="line.2079"></a>
-<span class="sourceLineNo">2080</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2080"></a>
-<span class="sourceLineNo">2081</span>     *<a name="line.2081"></a>
-<span class="sourceLineNo">2082</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2082"></a>
-<span class="sourceLineNo">2083</span>     * @param valueToFind  the value to find<a name="line.2083"></a>
-<span class="sourceLineNo">2084</span>     * @return the index of the value within the array,<a name="line.2084"></a>
-<span class="sourceLineNo">2085</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2085"></a>
-<span class="sourceLineNo">2086</span>     */<a name="line.2086"></a>
-<span class="sourceLineNo">2087</span>    public static int indexOf(final int[] array, final int valueToFind) {<a name="line.2087"></a>
-<span class="sourceLineNo">2088</span>        return indexOf(array, valueToFind, 0);<a name="line.2088"></a>
-<span class="sourceLineNo">2089</span>    }<a name="line.2089"></a>
-<span class="sourceLineNo">2090</span><a name="line.2090"></a>
-<span class="sourceLineNo">2091</span>    /**<a name="line.2091"></a>
-<span class="sourceLineNo">2092</span>     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2092"></a>
-<span class="sourceLineNo">2093</span>     *<a name="line.2093"></a>
-<span class="sourceLineNo">2094</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2094"></a>
-<span class="sourceLineNo">2095</span>     *<a name="line.2095"></a>
-<span class="sourceLineNo">2096</span>     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array<a name="line.2096"></a>
-<span class="sourceLineNo">2097</span>     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;<a name="line.2097"></a>
-<span class="sourceLineNo">2098</span>     *<a name="line.2098"></a>
-<span class="sourceLineNo">2099</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2099"></a>
-<span class="sourceLineNo">2100</span>     * @param valueToFind  the value to find<a name="line.2100"></a>
-<span class="sourceLineNo">2101</span>     * @param startIndex  the index to start searching at<a name="line.2101"></a>
-<span class="sourceLineNo">2102</span>     * @return the index of the value within the array,<a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span>     */<a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>    public static int indexOf(final int[] array, final int valueToFind, int startIndex) {<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>        if (array == null) {<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>            return INDEX_NOT_FOUND;<a name="line.2107"></a>
-<span class="sourceLineNo">2108</span>        }<a name="line.2108"></a>
-<span class="sourceLineNo">2109</span>        if (startIndex &lt; 0) {<a name="line.2109"></a>
-<span class="sourceLineNo">2110</span>            startIndex = 0;<a name="line.2110"></a>
+<span class="sourceLineNo">2067</span>      * &lt;p&gt;Examples:<a name="line.2067"></a>
+<span class="sourceLineNo">2068</span>     *     &lt;ul&gt;<a name="line.2068"></a>
+<span class="sourceLineNo">2069</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;<a name="line.2069"></a>
+<span class="sourceLineNo">2070</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;<a name="line.2070"></a>
+<span class="sourceLineNo">2071</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;<a name="line.2071"></a>
+<span class="sourceLineNo">2072</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2072"></a>
+<span class="sourceLineNo">2073</span>     *     &lt;/ul&gt;<a name="line.2073"></a>
+<span class="sourceLineNo">2074</span>     * &lt;/p&gt;<a name="line.2074"></a>
+<span class="sourceLineNo">2075</span>     * <a name="line.2075"></a>
+<span class="sourceLineNo">2076</span>     * @param array  the array to swap, may be {@code null}<a name="line.2076"></a>
+<span class="sourceLineNo">2077</span>     * @param offset1 the index of the first element to swap<a name="line.2077"></a>
+<span class="sourceLineNo">2078</span>     * @param offset2 the index of the second element to swap<a name="line.2078"></a>
+<span class="sourceLineNo">2079</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range<a name="line.2079"></a>
+<span class="sourceLineNo">2080</span>     */<a name="line.2080"></a>
+<span class="sourceLineNo">2081</span>    public static void swap(final boolean[] array, int offset1, int offset2) {<a name="line.2081"></a>
+<span class="sourceLineNo">2082</span>        if (array == null) {<a name="line.2082"></a>
+<span class="sourceLineNo">2083</span>            return;<a name="line.2083"></a>
+<span class="sourceLineNo">2084</span>        }<a name="line.2084"></a>
+<span class="sourceLineNo">2085</span>        swap(array, offset1, offset2, 1);<a name="line.2085"></a>
+<span class="sourceLineNo">2086</span>    }<a name="line.2086"></a>
+<span class="sourceLineNo">2087</span><a name="line.2087"></a>
+<span class="sourceLineNo">2088</span>    /**<a name="line.2088"></a>
+<span class="sourceLineNo">2089</span>     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;<a name="line.2089"></a>
+<span class="sourceLineNo">2090</span>     * <a name="line.2090"></a>
+<span class="sourceLineNo">2091</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2091"></a>
+<span class="sourceLineNo">2092</span>     * <a name="line.2092"></a>
+<span class="sourceLineNo">2093</span>     * &lt;p&gt;Examples:<a name="line.2093"></a>
+<span class="sourceLineNo">2094</span>     *     &lt;ul&gt;<a name="line.2094"></a>
+<span class="sourceLineNo">2095</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 2, 1) -&gt; ["3", "2", "1", "4"]&lt;/li&gt;<a name="line.2095"></a>
+<span class="sourceLineNo">2096</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 0, 1) -&gt; ["1", "2", "3", "4"]&lt;/li&gt;<a name="line.2096"></a>
+<span class="sourceLineNo">2097</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 2, 0, 2) -&gt; ["3", "4", "1", "2"]&lt;/li&gt;<a name="line.2097"></a>
+<span class="sourceLineNo">2098</span>     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 3, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2098"></a>
+<span class="sourceLineNo">2099</span>     *     &lt;/ul&gt;<a name="line.2099"></a>
+<span class="sourceLineNo">2100</span>     * &lt;/p&gt;<a name="line.2100"></a>
+<span class="sourceLineNo">2101</span>     * <a name="line.2101"></a>
+<span class="sourceLineNo">2102</span>     * @param array the array to swap, may be {@code null}<a name="line.2102"></a>
+<span class="sourceLineNo">2103</span>     * @param offset1 the index of the first element in the series to swap<a name="line.2103"></a>
+<span class="sourceLineNo">2104</span>     * @param offset2 the index of the second element in the series to swap<a name="line.2104"></a>
+<span class="sourceLineNo">2105</span>     * @param len the number of elements to swap starting with the given indices<a name="line.2105"></a>
+<span class="sourceLineNo">2106</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range<a name="line.2106"></a>
+<span class="sourceLineNo">2107</span>     */<a name="line.2107"></a>
+<span class="sourceLineNo">2108</span>    public static void swap(final boolean[] array,  int offset1, int offset2, int len) {<a name="line.2108"></a>
+<span class="sourceLineNo">2109</span>        if (array == null) {<a name="line.2109"></a>
+<span class="sourceLineNo">2110</span>            return;<a name="line.2110"></a>
 <span class="sourceLineNo">2111</span>        }<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span>        for (int i = startIndex; i &lt; array.length; i++) {<a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>            if (valueToFind == array[i]) {<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>                return i;<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>            }<a name="line.2115"></a>
+<span class="sourceLineNo">2112</span>        for (int i = 0; i &lt; len; i++) {<a name="line.2112"></a>
+<span class="sourceLineNo">2113</span>                boolean aux = array[offset1 + i];<a name="line.2113"></a>
+<span class="sourceLineNo">2114</span>                array[offset1 + i] = array[offset2 + i];<a name="line.2114"></a>
+<span class="sourceLineNo">2115</span>                array[offset2 + i] = aux;<a name="line.2115"></a>
 <span class="sourceLineNo">2116</span>        }<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>        return INDEX_NOT_FOUND;<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span>    }<a name="line.2118"></a>
-<span class="sourceLineNo">2119</span><a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>    /**<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span>     * &lt;p&gt;Finds the last index of the given value within the array.&lt;/p&gt;<a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>     *<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>     *<a name="line.2124"></a>
-<span class="sourceLineNo">2125</span>     * @param array  the array to travers backwords looking for the object, may be {@code null}<a name="line.2125"></a>
-<span class="sourceLineNo">2126</span>     * @param valueToFind  the object to find<a name="line.2126"></a>
-<span class="sourceLineNo">2127</span>     * @return the last index of the value within the array,<a name="line.2127"></a>
-<span class="sourceLineNo">2128</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>     */<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>    public static int lastIndexOf(final int[] array, final int valueToFind) {<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>        return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>    }<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span><a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>    /**<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>     * &lt;p&gt;Finds the last index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span>     *<a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>     *<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span>     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the<a name="line.2139"></a>
-<span class="sourceLineNo">2140</span>     * array length will search from the end of the array.&lt;/p&gt;<a name="line.2140"></a>
-<span class="sourceLineNo">2141</span>     *<a name="line.2141"></a>
-<span class="sourceLineNo">2142</span>     * @param array  the array to traverse for looking for the object, may be {@code null}<a name="line.2142"></a>
-<span class="sourceLineNo">2143</span>     * @param valueToFind  the value to find<a name="line.2143"></a>
-<span class="sourceLineNo">2144</span>     * @param startIndex  the start index to travers backwards from<a name="line.2144"></a>
-<span class="sourceLineNo">2145</span>     * @return the last index of the value within the array,<a name="line.2145"></a>
-<span class="sourceLineNo">2146</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>     */<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span>    public static int lastIndexOf(final int[] array, final int valueToFind, int startIndex) {<a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>        if (array == null) {<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>            return INDEX_NOT_FOUND;<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span>        }<a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>        if (startIndex &lt; 0) {<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>            return INDEX_NOT_FOUND;<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>        } else if (startIndex &gt;= array.length) {<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>            startIndex = array.length - 1;<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>        }<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>        for (int i = startIndex; i &gt;= 0; i--) {<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span>            if (valueToFind == array[i]) {<a name="line.2158"></a>
-<span class="sourceLineNo">2159</span>                return i;<a name="line.2159"></a>
-<span class="sourceLineNo">2160</span>            }<a name="line.2160"></a>
-<span class="sourceLineNo">2161</span>        }<a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>        return INDEX_NOT_FOUND;<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>    }<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span><a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>    /**<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>     * &lt;p&gt;Checks if the value is in the given array.&lt;/p&gt;<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>     *<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>     *<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span>     * @param array  the array to search through<a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>     * @param valueToFind  the value to find<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>     * @return {@code true} if the array contains the object<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>     */<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>    public static boolean contains(final int[] array, final int valueToFind) {<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>        return indexOf(array, valueToFind) != INDEX_NOT_FOUND;<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>    }<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span><a name="line.2177"></a>
-<span class="sourceLineNo">2178</span>    // short IndexOf<a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>    //-----------------------------------------------------------------------<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span>    /**<a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>     *<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span>     *<a name="line.2184"></a>
-<span class="sourceLineNo">2185</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>     * @param valueToFind  the value to find<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span>     * @return the index of the value within the array,<a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>     */<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>    public static int indexOf(final short[] array, final short valueToFind) {<a name="line.2190"></a>
-<span class="sourceLineNo">2191</span>        return indexOf(array, valueToFind, 0);<a name="line.2191"></a>
-<span class="sourceLineNo">2192</span>    }<a name="line.2192"></a>
-<span class="sourceLineNo">2193</span><a name="line.2193"></a>
-<span class="sourceLineNo">2194</span>    /**<a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>     *<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>     *<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>     *<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span>     * @param valueToFind  the value to find<a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>     * @param startIndex  the index to start searching at<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>     * @return the index of the value within the array,<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>     */<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>    public static int indexOf(final short[] array, final short valueToFind, int startIndex) {<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>        if (array == null) {<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>            return INDEX_NOT_FOUND;<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>        }<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>        if (startIndex &lt; 0) {<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span>            startIndex = 0;<a name="line.2213"></a>
-<span class="sourceLineNo">2214</span>        }<a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>        for (int i = startIndex; i &lt; array.length; i++) {<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span>            if (valueToFind == array[i]) {<a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>                return i;<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>            }<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>        }<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>        return INDEX_NOT_FOUND;<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span>    }<a name="line.2221"></a>
-<span class="sourceLineNo">2222</span><a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>    /**<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>     * &lt;p&gt;Finds the last index of the given value within the array.&lt;/p&gt;<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>     *<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>     *<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>     * @param array  the array to travers backwords looking for the object, may be {@code null}<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>     * @param valueToFind  the object to find<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>     * @return the last index of the value within the array,<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2231"></a>
+<span class="sourceLineNo">2117</span>    }<a name="line.2117"></a>
+<span class="sourceLineNo">2118</span><a name="line.2118"></a>
+<span class="sourceLineNo">2119</span>    /**<a name="line.2119"></a>
+<span class="sourceLineNo">2120</span>     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;<a name="line.2120"></a>
+<span class="sourceLineNo">2121</span>     * <a name="line.2121"></a>
+<span class="sourceLineNo">2122</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2122"></a>
+<span class="sourceLineNo">2123</span>     * <a name="line.2123"></a>
+<span class="sourceLineNo">2124</span>     * &lt;p&gt;Examples:<a name="line.2124"></a>
+<span class="sourceLineNo">2125</span>     *     &lt;ul&gt;<a name="line.2125"></a>
+<span class="sourceLineNo">2126</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true, false], 0, 2, 1) -&gt; [true, false, true, false]&lt;/li&gt;<a name="line.2126"></a>
+<span class="sourceLineNo">2127</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true, false], 0, 0, 1) -&gt; [true, false, true, false]&lt;/li&gt;<a name="line.2127"></a>
+<span class="sourceLineNo">2128</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true, false], 0, 2, 2) -&gt; [true, false, true, false]&lt;/li&gt;<a name="line.2128"></a>
+<span class="sourceLineNo">2129</span>     *         &lt;li&gt;ArrayUtils.swap([true, false, true, false], 0, 5, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2129"></a>
+<span class="sourceLineNo">2130</span>     *     &lt;/ul&gt;<a name="line.2130"></a>
+<span class="sourceLineNo">2131</span>     * &lt;/p&gt;<a name="line.2131"></a>
+<span class="sourceLineNo">2132</span>     * <a name="line.2132"></a>
+<span class="sourceLineNo">2133</span>     * @param array the array to swap, may be {@code null}<a name="line.2133"></a>
+<span class="sourceLineNo">2134</span>     * @param offset1 the index of the first element in the series to swap<a name="line.2134"></a>
+<span class="sourceLineNo">2135</span>     * @param offset2 the index of the second element in the series to swap<a name="line.2135"></a>
+<span class="sourceLineNo">2136</span>     * @param len the number of elements to swap starting with the given indices<a name="line.2136"></a>
+<span class="sourceLineNo">2137</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range<a name="line.2137"></a>
+<span class="sourceLineNo">2138</span>     */<a name="line.2138"></a>
+<span class="sourceLineNo">2139</span><a name="line.2139"></a>
+<span class="sourceLineNo">2140</span>    public static void swap(final byte[] array,  int offset1, int offset2, int len) {<a name="line.2140"></a>
+<span class="sourceLineNo">2141</span>        if (array == null) {<a name="line.2141"></a>
+<span class="sourceLineNo">2142</span>            return;<a name="line.2142"></a>
+<span class="sourceLineNo">2143</span>        }<a name="line.2143"></a>
+<span class="sourceLineNo">2144</span>        for (int i = 0; i &lt; len; i++) {<a name="line.2144"></a>
+<span class="sourceLineNo">2145</span>            byte aux = array[offset1 + i];<a name="line.2145"></a>
+<span class="sourceLineNo">2146</span>            array[offset1 + i] = array[offset2 + i];<a name="line.2146"></a>
+<span class="sourceLineNo">2147</span>            array[offset2 + i] = aux;<a name="line.2147"></a>
+<span class="sourceLineNo">2148</span>        }<a name="line.2148"></a>
+<span class="sourceLineNo">2149</span>    }<a name="line.2149"></a>
+<span class="sourceLineNo">2150</span><a name="line.2150"></a>
+<span class="sourceLineNo">2151</span>    /**<a name="line.2151"></a>
+<span class="sourceLineNo">2152</span>     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;<a name="line.2152"></a>
+<span class="sourceLineNo">2153</span>     * <a name="line.2153"></a>
+<span class="sourceLineNo">2154</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2154"></a>
+<span class="sourceLineNo">2155</span>     * <a name="line.2155"></a>
+<span class="sourceLineNo">2156</span>     * &lt;p&gt;Examples:<a name="line.2156"></a>
+<span class="sourceLineNo">2157</span>     *     &lt;ul&gt;<a name="line.2157"></a>
+<span class="sourceLineNo">2158</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -&gt; [3, 2, 1, 4]&lt;/li&gt;<a name="line.2158"></a>
+<span class="sourceLineNo">2159</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -&gt; [1, 2, 3, 4]&lt;/li&gt;<a name="line.2159"></a>
+<span class="sourceLineNo">2160</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -&gt; [3, 4, 1, 2]&lt;/li&gt;<a name="line.2160"></a>
+<span class="sourceLineNo">2161</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2161"></a>
+<span class="sourceLineNo">2162</span>     *     &lt;/ul&gt;<a name="line.2162"></a>
+<span class="sourceLineNo">2163</span>     * &lt;/p&gt;<a name="line.2163"></a>
+<span class="sourceLineNo">2164</span>     * <a name="line.2164"></a>
+<span class="sourceLineNo">2165</span>     * @param array the array to swap, may be {@code null}<a name="line.2165"></a>
+<span class="sourceLineNo">2166</span>     * @param offset1 the index of the first element in the series to swap<a name="line.2166"></a>
+<span class="sourceLineNo">2167</span>     * @param offset2 the index of the second element in the series to swap<a name="line.2167"></a>
+<span class="sourceLineNo">2168</span>     * @param len the number of elements to swap starting with the given indices<a name="line.2168"></a>
+<span class="sourceLineNo">2169</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range<a name="line.2169"></a>
+<span class="sourceLineNo">2170</span>     */<a name="line.2170"></a>
+<span class="sourceLineNo">2171</span>    public static void swap(final char[] array,  int offset1, int offset2, int len) {<a name="line.2171"></a>
+<span class="sourceLineNo">2172</span>        if (array == null) {<a name="line.2172"></a>
+<span class="sourceLineNo">2173</span>            return;<a name="line.2173"></a>
+<span class="sourceLineNo">2174</span>        }<a name="line.2174"></a>
+<span class="sourceLineNo">2175</span>        for (int i = 0; i &lt; len; i++) {<a name="line.2175"></a>
+<span class="sourceLineNo">2176</span>            char aux = array[offset1 + i];<a name="line.2176"></a>
+<span class="sourceLineNo">2177</span>            array[offset1 + i] = array[offset2 + i];<a name="line.2177"></a>
+<span class="sourceLineNo">2178</span>            array[offset2 + i] = aux;<a name="line.2178"></a>
+<span class="sourceLineNo">2179</span>        }<a name="line.2179"></a>
+<span class="sourceLineNo">2180</span>    }<a name="line.2180"></a>
+<span class="sourceLineNo">2181</span><a name="line.2181"></a>
+<span class="sourceLineNo">2182</span>    /**<a name="line.2182"></a>
+<span class="sourceLineNo">2183</span>     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;<a name="line.2183"></a>
+<span class="sourceLineNo">2184</span>     * <a name="line.2184"></a>
+<span class="sourceLineNo">2185</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2185"></a>
+<span class="sourceLineNo">2186</span>     * <a name="line.2186"></a>
+<span class="sourceLineNo">2187</span>     * &lt;p&gt;Examples:<a name="line.2187"></a>
+<span class="sourceLineNo">2188</span>     *     &lt;ul&gt;<a name="line.2188"></a>
+<span class="sourceLineNo">2189</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -&gt; [3, 2, 1, 4]&lt;/li&gt;<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -&gt; [1, 2, 3, 4]&lt;/li&gt;<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -&gt; [3, 4, 1, 2]&lt;/li&gt;<a name="line.2191"></a>
+<span class="sourceLineNo">2192</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2192"></a>
+<span class="sourceLineNo">2193</span>     *     &lt;/ul&gt;<a name="line.2193"></a>
+<span class="sourceLineNo">2194</span>     * &lt;/p&gt;<a name="line.2194"></a>
+<span class="sourceLineNo">2195</span>     * <a name="line.2195"></a>
+<span class="sourceLineNo">2196</span>     * @param array the array to swap, may be {@code null}<a name="line.2196"></a>
+<span class="sourceLineNo">2197</span>     * @param offset1 the index of the first element in the series to swap<a name="line.2197"></a>
+<span class="sourceLineNo">2198</span>     * @param offset2 the index of the second element in the series to swap<a name="line.2198"></a>
+<span class="sourceLineNo">2199</span>     * @param len the number of elements to swap starting with the given indices<a name="line.2199"></a>
+<span class="sourceLineNo">2200</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range<a name="line.2200"></a>
+<span class="sourceLineNo">2201</span>     */<a name="line.2201"></a>
+<span class="sourceLineNo">2202</span>    public static void swap(final double[] array,  int offset1, int offset2, int len) {<a name="line.2202"></a>
+<span class="sourceLineNo">2203</span>        if (array == null) {<a name="line.2203"></a>
+<span class="sourceLineNo">2204</span>            return;<a name="line.2204"></a>
+<span class="sourceLineNo">2205</span>        }<a name="line.2205"></a>
+<span class="sourceLineNo">2206</span>        for (int i = 0; i &lt; len; i++) {<a name="line.2206"></a>
+<span class="sourceLineNo">2207</span>            double aux = array[offset1 + i];<a name="line.2207"></a>
+<span class="sourceLineNo">2208</span>            array[offset1 + i] = array[offset2 + i];<a name="line.2208"></a>
+<span class="sourceLineNo">2209</span>            array[offset2 + i] = aux;<a name="line.2209"></a>
+<span class="sourceLineNo">2210</span>        }<a name="line.2210"></a>
+<span class="sourceLineNo">2211</span>    }<a name="line.2211"></a>
+<span class="sourceLineNo">2212</span><a name="line.2212"></a>
+<span class="sourceLineNo">2213</span>    /**<a name="line.2213"></a>
+<span class="sourceLineNo">2214</span>     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;<a name="line.2214"></a>
+<span class="sourceLineNo">2215</span>     * <a name="line.2215"></a>
+<span class="sourceLineNo">2216</span>     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;<a name="line.2216"></a>
+<span class="sourceLineNo">2217</span>     * <a name="line.2217"></a>
+<span class="sourceLineNo">2218</span>     * &lt;p&gt;Examples:<a name="line.2218"></a>
+<span class="sourceLineNo">2219</span>     *     &lt;ul&gt;<a name="line.2219"></a>
+<span class="sourceLineNo">2220</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -&gt; [3, 2, 1, 4]&lt;/li&gt;<a name="line.2220"></a>
+<span class="sourceLineNo">2221</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -&gt; [1, 2, 3, 4]&lt;/li&gt;<a name="line.2221"></a>
+<span class="sourceLineNo">2222</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -&gt; [3, 4, 1, 2]&lt;/li&gt;<a name="line.2222"></a>
+<span class="sourceLineNo">2223</span>     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;<a name="line.2223"></a>
+<span class="sourceLineNo">2224</span>     *     &lt;/ul&gt;<a name="line.2224"></a>
+<span class="sourceLineNo">2225</span>     * &lt;/p&gt;<a name="line.2225"></a>
+<span class="sourceLineNo">2226</span>     * <a name="line.2226"></a>
+<span class="sourceLineNo">2227</span>     * @param array the array to swap, may be {@code null}<a name="line.2227"></a>
+<span class="sourceLineNo">2228</span>     * @param offset1 the index of the first element in the series to swap<a name="line.2228"></a>
+<span class="sourceLineNo">2229</span>     * @param offset2 the index of the second element in the series to swap<a name="line.2229"></a>
+<span class="sourceLineNo">2230</span>     * @param len the number of elements to swap starting with the given indices<a name="line.2230"></a>
+<span class="sourceLineNo">2231</span>     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range<a name="line.2231"></a>
 <span class="sourceLineNo">2232</span>     */<a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>    public static int lastIndexOf(final short[] array, final short valueToFind) {<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>        return lastIndexOf(array, valueToFind, Integer.MAX_VALUE);<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>    }<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span><a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>    /**<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>     * &lt;p&gt;Finds the last index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>     *<a name="line.2239"></a>
-<span class="sourceLineNo">2240</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2240"></a>
-<span class="sourceLineNo">2241</span>     *<a name="line.2241"></a>
-<span class="sourceLineNo">2242</span>     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the<a name="line.2242"></a>
-<span class="sourceLineNo">2243</span>     * array length will search from the end of the array.&lt;/p&gt;<a name="line.2243"></a>
-<span class="sourceLineNo">2244</span>     *<a name="line.2244"></a>
-<span class="sourceLineNo">2245</span>     * @param array  the array to traverse for looking for the object, may be {@code null}<a name="line.2245"></a>
-<span class="sourceLineNo">2246</span>     * @param valueToFind  the value to find<a name="line.2246"></a>
-<span class="sourceLineNo">2247</span>     * @param startIndex  the start index to travers backwards from<a name="line.2247"></a>
-<span class="sourceLineNo">2248</span>     * @return the last index of the value within the array,<a name="line.2248"></a>
-<span class="sourceLineNo">2249</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2249"></a>
-<span class="sourceLineNo">2250</span>     */<a name="line.2250"></a>
-<span class="sourceLineNo">2251</span>    public static int lastIndexOf(final short[] array, final short valueToFind, int startIndex) {<a name="line.2251"></a>
-<span class="sourceLineNo">2252</span>        if (array == null) {<a name="line.2252"></a>
-<span class="sourceLineNo">2253</span>            return INDEX_NOT_FOUND;<a name="line.2253"></a>
-<span class="sourceLineNo">2254</span>        }<a name="line.2254"></a>
-<span class="sourceLineNo">2255</span>        if (startIndex &lt; 0) {<a name="line.2255"></a>
-<span class="sourceLineNo">2256</span>            return INDEX_NOT_FOUND;<a name="line.2256"></a>
-<span class="sourceLineNo">2257</span>        } else if (startIndex &gt;= array.length) {<a name="line.2257"></a>
-<span class="sourceLineNo">2258</span>            startIndex = array.length - 1;<a name="line.2258"></a>
-<span class="sourceLineNo">2259</span>        }<a name="line.2259"></a>
-<span class="sourceLineNo">2260</span>        for (int i = startIndex; i &gt;= 0; i--) {<a name="line.2260"></a>
-<span class="sourceLineNo">2261</span>            if (valueToFind == array[i]) {<a name="line.2261"></a>
-<span class="sourceLineNo">2262</span>                return i;<a name="line.2262"></a>
-<span class="sourceLineNo">2263</span>            }<a name="line.2263"></a>
-<span class="sourceLineNo">2264</span>        }<a name="line.2264"></a>
-<span class="sourceLineNo">2265</span>        return INDEX_NOT_FOUND;<a name="line.2265"></a>
-<span class="sourceLineNo">2266</span>    }<a name="line.2266"></a>
-<span class="sourceLineNo">2267</span><a name="line.2267"></a>
-<span class="sourceLineNo">2268</span>    /**<a name="line.2268"></a>
-<span class="sourceLineNo">2269</span>     * &lt;p&gt;Checks if the value is in the given array.&lt;/p&gt;<a name="line.2269"></a>
-<span class="sourceLineNo">2270</span>     *<a name="line.2270"></a>
-<span class="sourceLineNo">2271</span>     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;<a name="line.2271"></a>
-<span class="sourceLineNo">2272</span>     *<a name="line.2272"></a>
-<span class="sourceLineNo">2273</span>     * @param array  the array to search through<a name="line.2273"></a>
-<span class="sourceLineNo">2274</span>     * @param valueToFind  the value to find<a name="line.2274"></a>
-<span class="sourceLineNo">2275</span>     * @return {@code true} if the array contains the object<a name="line.2275"></a>
-<span class="sourceLineNo">2276</span>     */<a name="line.2276"></a>
-<span class="sourceLineNo">2277</span>    public static boolean contains(final short[] array, final short valueToFind) {<a name="line.2277"></a>
-<span class="sourceLineNo">2278</span>        return indexOf(array, valueToFind) != INDEX_NOT_FOUND;<a name="line.2278"></a>
-<span class="sourceLineNo">2279</span>    }<a name="line.2279"></a>
-<span class="sourceLineNo">2280</span><a name="line.2280"></a>
-<span class="sourceLineNo">2281</span>    // char IndexOf<a name="line.2281"></a>
-<span class="sourceLineNo">2282</span>    //-----------------------------------------------------------------------<a name="line.2282"></a>
-<span class="sourceLineNo">2283</span>    /**<a name="line.2283"></a>
-<span class="sourceLineNo">2284</span>     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;<a name="line.2284"></a>
-<span class="sourceLineNo">2285</span>     *<a name="line.2285"></a>
-<span class="sourceLineNo">2286</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2286"></a>
-<span class="sourceLineNo">2287</span>     *<a name="line.2287"></a>
-<span class="sourceLineNo">2288</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2288"></a>
-<span class="sourceLineNo">2289</span>     * @param valueToFind  the value to find<a name="line.2289"></a>
-<span class="sourceLineNo">2290</span>     * @return the index of the value within the array,<a name="line.2290"></a>
-<span class="sourceLineNo">2291</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2291"></a>
-<span class="sourceLineNo">2292</span>     * @since 2.1<a name="line.2292"></a>
-<span class="sourceLineNo">2293</span>     */<a name="line.2293"></a>
-<span class="sourceLineNo">2294</span>    public static int indexOf(final char[] array, final char valueToFind) {<a name="line.2294"></a>
-<span class="sourceLineNo">2295</span>        return indexOf(array, valueToFind, 0);<a name="line.2295"></a>
-<span class="sourceLineNo">2296</span>    }<a name="line.2296"></a>
-<span class="sourceLineNo">2297</span><a name="line.2297"></a>
-<span class="sourceLineNo">2298</span>    /**<a name="line.2298"></a>
-<span class="sourceLineNo">2299</span>     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;<a name="line.2299"></a>
-<span class="sourceLineNo">2300</span>     *<a name="line.2300"></a>
-<span class="sourceLineNo">2301</span>     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;<a name="line.2301"></a>
-<span class="sourceLineNo">2302</span>     *<a name="line.2302"></a>
-<span class="sourceLineNo">2303</span>     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array<a name="line.2303"></a>
-<span class="sourceLineNo">2304</span>     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;<a name="line.2304"></a>
-<span class="sourceLineNo">2305</span>     *<a name="line.2305"></a>
-<span class="sourceLineNo">2306</span>     * @param array  the array to search through for the object, may be {@code null}<a name="line.2306"></a>
-<span class="sourceLineNo">2307</span>     * @param valueToFind  the value to find<a name="line.2307"></a>
-<span class="sourceLineNo">2308</span>     * @param startIndex  the index to start searching at<a name="line.2308"></a>
-<span class="sourceLineNo">2309</span>     * @return the index of the value within the array,<a name="line.2309"></a>
-<span class="sourceLineNo">2310</span>     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input<a name="line.2310"></a>
-<span class="sourceLineNo">2311</span>     * @since 2.1<a name="line.2311"></a>
-<span class="sourceLineNo">2312</span>     */<a name="line.2312"></a>

[... 9748 lines stripped ...]


Mime
View raw message