commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r949864 [41/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/common...
Date Fri, 01 May 2015 20:55:53 GMT
Modified: websites/production/commons/content/proper/commons-lang/xref/org/apache/commons/lang3/ArrayUtils.html
==============================================================================
--- websites/production/commons/content/proper/commons-lang/xref/org/apache/commons/lang3/ArrayUtils.html (original)
+++ websites/production/commons/content/proper/commons-lang/xref/org/apache/commons/lang3/ArrayUtils.html Fri May  1 20:55:51 2015
@@ -1855,4750 +1855,5919 @@
 <a class="jxr_linenumber" name="L1847" href="#L1847">1847</a>         }
 <a class="jxr_linenumber" name="L1848" href="#L1848">1848</a>     }
 <a class="jxr_linenumber" name="L1849" href="#L1849">1849</a> 
-<a class="jxr_linenumber" name="L1850" href="#L1850">1850</a>     <em class="jxr_comment">// IndexOf search</em>
-<a class="jxr_linenumber" name="L1851" href="#L1851">1851</a>     <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L1852" href="#L1852">1852</a> 
-<a class="jxr_linenumber" name="L1853" href="#L1853">1853</a>     <em class="jxr_comment">// Object IndexOf</em>
-<a class="jxr_linenumber" name="L1854" href="#L1854">1854</a>     <em class="jxr_comment">//-----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L1855" href="#L1855">1855</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1856" href="#L1856">1856</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given object in the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1857" href="#L1857">1857</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1858" href="#L1858">1858</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1859" href="#L1859">1859</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1860" href="#L1860">1860</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1861" href="#L1861">1861</a> <em class="jxr_javadoccomment">     * @param objectToFind  the object to find, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1862" href="#L1862">1862</a> <em class="jxr_javadoccomment">     * @return the index of the object within the array,</em>
-<a class="jxr_linenumber" name="L1863" href="#L1863">1863</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L1864" href="#L1864">1864</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1865" href="#L1865">1865</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">final</strong> Object objectToFind) {
-<a class="jxr_linenumber" name="L1866" href="#L1866">1866</a>         <strong class="jxr_keyword">return</strong> indexOf(array, objectToFind, 0);
-<a class="jxr_linenumber" name="L1867" href="#L1867">1867</a>     }
-<a class="jxr_linenumber" name="L1868" href="#L1868">1868</a> 
-<a class="jxr_linenumber" name="L1869" href="#L1869">1869</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1870" href="#L1870">1870</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given object in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1871" href="#L1871">1871</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1872" href="#L1872">1872</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1873" href="#L1873">1873</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1874" href="#L1874">1874</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array</em>
-<a class="jxr_linenumber" name="L1875" href="#L1875">1875</a> <em class="jxr_javadoccomment">     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1876" href="#L1876">1876</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1877" href="#L1877">1877</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1878" href="#L1878">1878</a> <em class="jxr_javadoccomment">     * @param objectToFind  the object to find, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1879" href="#L1879">1879</a> <em class="jxr_javadoccomment">     * @param startIndex  the index to start searching at</em>
-<a class="jxr_linenumber" name="L1880" href="#L1880">1880</a> <em class="jxr_javadoccomment">     * @return the index of the object within the array starting at the index,</em>
-<a class="jxr_linenumber" name="L1881" href="#L1881">1881</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L1882" href="#L1882">1882</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1883" href="#L1883">1883</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">final</strong> Object objectToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L1884" href="#L1884">1884</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1885" href="#L1885">1885</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L1886" href="#L1886">1886</a>         }
-<a class="jxr_linenumber" name="L1887" href="#L1887">1887</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L1888" href="#L1888">1888</a>             startIndex = 0;
-<a class="jxr_linenumber" name="L1889" href="#L1889">1889</a>         }
-<a class="jxr_linenumber" name="L1890" href="#L1890">1890</a>         <strong class="jxr_keyword">if</strong> (objectToFind == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1891" href="#L1891">1891</a>             <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &lt; array.length; i++) {
-<a class="jxr_linenumber" name="L1892" href="#L1892">1892</a>                 <strong class="jxr_keyword">if</strong> (array[i] == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1893" href="#L1893">1893</a>                     <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L1894" href="#L1894">1894</a>                 }
-<a class="jxr_linenumber" name="L1895" href="#L1895">1895</a>             }
-<a class="jxr_linenumber" name="L1896" href="#L1896">1896</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (array.getClass().getComponentType().isInstance(objectToFind)) {
-<a class="jxr_linenumber" name="L1897" href="#L1897">1897</a>             <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &lt; array.length; i++) {
-<a class="jxr_linenumber" name="L1898" href="#L1898">1898</a>                 <strong class="jxr_keyword">if</strong> (objectToFind.equals(array[i])) {
-<a class="jxr_linenumber" name="L1899" href="#L1899">1899</a>                     <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L1900" href="#L1900">1900</a>                 }
-<a class="jxr_linenumber" name="L1901" href="#L1901">1901</a>             }
+<a class="jxr_linenumber" name="L1850" href="#L1850">1850</a>     <em class="jxr_comment">// Swap</em>
+<a class="jxr_linenumber" name="L1851" href="#L1851">1851</a>     <em class="jxr_comment">//-----------------------------------------------------------------------</em>
+<a class="jxr_linenumber" name="L1852" href="#L1852">1852</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L1853" href="#L1853">1853</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1854" href="#L1854">1854</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1855" href="#L1855">1855</a> <em class="jxr_javadoccomment">     * &lt;p&gt;There is no special handling for multi-dimensional arrays.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1856" href="#L1856">1856</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1857" href="#L1857">1857</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1858" href="#L1858">1858</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L1859" href="#L1859">1859</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1860" href="#L1860">1860</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1861" href="#L1861">1861</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 2) -&gt; ["3", "2", "1"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1862" href="#L1862">1862</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 0) -&gt; ["1", "2", "3"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1863" href="#L1863">1863</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 1, 0) -&gt; ["2", "1", "3"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1864" href="#L1864">1864</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3"], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1865" href="#L1865">1865</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1866" href="#L1866">1866</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1867" href="#L1867">1867</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1868" href="#L1868">1868</a> <em class="jxr_javadoccomment">     * @param array the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1869" href="#L1869">1869</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L1870" href="#L1870">1870</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L1871" href="#L1871">1871</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L1872" href="#L1872">1872</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L1873" href="#L1873">1873</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L1874" href="#L1874">1874</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L1875" href="#L1875">1875</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L1876" href="#L1876">1876</a>         }
+<a class="jxr_linenumber" name="L1877" href="#L1877">1877</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L1878" href="#L1878">1878</a>     }
+<a class="jxr_linenumber" name="L1879" href="#L1879">1879</a> 
+<a class="jxr_linenumber" name="L1880" href="#L1880">1880</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L1881" href="#L1881">1881</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1882" href="#L1882">1882</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1883" href="#L1883">1883</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1884" href="#L1884">1884</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1885" href="#L1885">1885</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1886" href="#L1886">1886</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1887" href="#L1887">1887</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 2) -&gt; [true, false, true]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1888" href="#L1888">1888</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 0) -&gt; [true, false, true]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1889" href="#L1889">1889</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 1, 0) -&gt; [false, true, true]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1890" href="#L1890">1890</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([true, false, true], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1891" href="#L1891">1891</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1892" href="#L1892">1892</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1893" href="#L1893">1893</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L1894" href="#L1894">1894</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1895" href="#L1895">1895</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L1896" href="#L1896">1896</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L1897" href="#L1897">1897</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L1898" href="#L1898">1898</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L1899" href="#L1899">1899</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L1900" href="#L1900">1900</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L1901" href="#L1901">1901</a>             <strong class="jxr_keyword">return</strong>;
 <a class="jxr_linenumber" name="L1902" href="#L1902">1902</a>         }
-<a class="jxr_linenumber" name="L1903" href="#L1903">1903</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
+<a class="jxr_linenumber" name="L1903" href="#L1903">1903</a>         swap(array, offset1, offset2, 1);
 <a class="jxr_linenumber" name="L1904" href="#L1904">1904</a>     }
 <a class="jxr_linenumber" name="L1905" href="#L1905">1905</a> 
 <a class="jxr_linenumber" name="L1906" href="#L1906">1906</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1907" href="#L1907">1907</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given object within the array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1907" href="#L1907">1907</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
 <a class="jxr_linenumber" name="L1908" href="#L1908">1908</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1909" href="#L1909">1909</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1909" href="#L1909">1909</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
 <a class="jxr_linenumber" name="L1910" href="#L1910">1910</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1911" href="#L1911">1911</a> <em class="jxr_javadoccomment">     * @param array  the array to travers backwords looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1912" href="#L1912">1912</a> <em class="jxr_javadoccomment">     * @param objectToFind  the object to find, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1913" href="#L1913">1913</a> <em class="jxr_javadoccomment">     * @return the last index of the object within the array,</em>
-<a class="jxr_linenumber" name="L1914" href="#L1914">1914</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L1915" href="#L1915">1915</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1916" href="#L1916">1916</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">final</strong> Object objectToFind) {
-<a class="jxr_linenumber" name="L1917" href="#L1917">1917</a>         <strong class="jxr_keyword">return</strong> lastIndexOf(array, objectToFind, Integer.MAX_VALUE);
-<a class="jxr_linenumber" name="L1918" href="#L1918">1918</a>     }
-<a class="jxr_linenumber" name="L1919" href="#L1919">1919</a> 
-<a class="jxr_linenumber" name="L1920" href="#L1920">1920</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1921" href="#L1921">1921</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given object in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1922" href="#L1922">1922</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1923" href="#L1923">1923</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1924" href="#L1924">1924</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1925" href="#L1925">1925</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than</em>
-<a class="jxr_linenumber" name="L1926" href="#L1926">1926</a> <em class="jxr_javadoccomment">     * the array length will search from the end of the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1927" href="#L1927">1927</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1928" href="#L1928">1928</a> <em class="jxr_javadoccomment">     * @param array  the array to traverse for looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1929" href="#L1929">1929</a> <em class="jxr_javadoccomment">     * @param objectToFind  the object to find, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1930" href="#L1930">1930</a> <em class="jxr_javadoccomment">     * @param startIndex  the start index to travers backwards from</em>
-<a class="jxr_linenumber" name="L1931" href="#L1931">1931</a> <em class="jxr_javadoccomment">     * @return the last index of the object within the array,</em>
-<a class="jxr_linenumber" name="L1932" href="#L1932">1932</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L1933" href="#L1933">1933</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1934" href="#L1934">1934</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">final</strong> Object objectToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L1935" href="#L1935">1935</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1936" href="#L1936">1936</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L1937" href="#L1937">1937</a>         }
-<a class="jxr_linenumber" name="L1938" href="#L1938">1938</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L1939" href="#L1939">1939</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L1940" href="#L1940">1940</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (startIndex &gt;= array.length) {
-<a class="jxr_linenumber" name="L1941" href="#L1941">1941</a>             startIndex = array.length - 1;
-<a class="jxr_linenumber" name="L1942" href="#L1942">1942</a>         }
-<a class="jxr_linenumber" name="L1943" href="#L1943">1943</a>         <strong class="jxr_keyword">if</strong> (objectToFind == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1944" href="#L1944">1944</a>             <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &gt;= 0; i--) {
-<a class="jxr_linenumber" name="L1945" href="#L1945">1945</a>                 <strong class="jxr_keyword">if</strong> (array[i] == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L1946" href="#L1946">1946</a>                     <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L1947" href="#L1947">1947</a>                 }
-<a class="jxr_linenumber" name="L1948" href="#L1948">1948</a>             }
-<a class="jxr_linenumber" name="L1949" href="#L1949">1949</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (array.getClass().getComponentType().isInstance(objectToFind)) {
-<a class="jxr_linenumber" name="L1950" href="#L1950">1950</a>             <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &gt;= 0; i--) {
-<a class="jxr_linenumber" name="L1951" href="#L1951">1951</a>                 <strong class="jxr_keyword">if</strong> (objectToFind.equals(array[i])) {
-<a class="jxr_linenumber" name="L1952" href="#L1952">1952</a>                     <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L1953" href="#L1953">1953</a>                 }
-<a class="jxr_linenumber" name="L1954" href="#L1954">1954</a>             }
-<a class="jxr_linenumber" name="L1955" href="#L1955">1955</a>         }
-<a class="jxr_linenumber" name="L1956" href="#L1956">1956</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L1957" href="#L1957">1957</a>     }
-<a class="jxr_linenumber" name="L1958" href="#L1958">1958</a> 
-<a class="jxr_linenumber" name="L1959" href="#L1959">1959</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1960" href="#L1960">1960</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Checks if the object is in the given array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1961" href="#L1961">1961</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1962" href="#L1962">1962</a> <em class="jxr_javadoccomment">     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1963" href="#L1963">1963</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1964" href="#L1964">1964</a> <em class="jxr_javadoccomment">     * @param array  the array to search through</em>
-<a class="jxr_linenumber" name="L1965" href="#L1965">1965</a> <em class="jxr_javadoccomment">     * @param objectToFind  the object to find</em>
-<a class="jxr_linenumber" name="L1966" href="#L1966">1966</a> <em class="jxr_javadoccomment">     * @return {@code true} if the array contains the object</em>
-<a class="jxr_linenumber" name="L1967" href="#L1967">1967</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1968" href="#L1968">1968</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> Object[] array, <strong class="jxr_keyword">final</strong> Object objectToFind) {
-<a class="jxr_linenumber" name="L1969" href="#L1969">1969</a>         <strong class="jxr_keyword">return</strong> indexOf(array, objectToFind) != INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L1970" href="#L1970">1970</a>     }
-<a class="jxr_linenumber" name="L1971" href="#L1971">1971</a> 
-<a class="jxr_linenumber" name="L1972" href="#L1972">1972</a>     <em class="jxr_comment">// long IndexOf</em>
-<a class="jxr_linenumber" name="L1973" href="#L1973">1973</a>     <em class="jxr_comment">//-----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L1974" href="#L1974">1974</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1975" href="#L1975">1975</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1976" href="#L1976">1976</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1977" href="#L1977">1977</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1978" href="#L1978">1978</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1979" href="#L1979">1979</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1980" href="#L1980">1980</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L1981" href="#L1981">1981</a> <em class="jxr_javadoccomment">     * @return the index of the value within the array,</em>
-<a class="jxr_linenumber" name="L1982" href="#L1982">1982</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L1983" href="#L1983">1983</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L1984" href="#L1984">1984</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> valueToFind) {
-<a class="jxr_linenumber" name="L1985" href="#L1985">1985</a>         <strong class="jxr_keyword">return</strong> indexOf(array, valueToFind, 0);
-<a class="jxr_linenumber" name="L1986" href="#L1986">1986</a>     }
-<a class="jxr_linenumber" name="L1987" href="#L1987">1987</a> 
-<a class="jxr_linenumber" name="L1988" href="#L1988">1988</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L1989" href="#L1989">1989</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1990" href="#L1990">1990</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1991" href="#L1991">1991</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1992" href="#L1992">1992</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1993" href="#L1993">1993</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array</em>
-<a class="jxr_linenumber" name="L1994" href="#L1994">1994</a> <em class="jxr_javadoccomment">     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L1995" href="#L1995">1995</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L1996" href="#L1996">1996</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L1997" href="#L1997">1997</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L1998" href="#L1998">1998</a> <em class="jxr_javadoccomment">     * @param startIndex  the index to start searching at</em>
-<a class="jxr_linenumber" name="L1999" href="#L1999">1999</a> <em class="jxr_javadoccomment">     * @return the index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2000" href="#L2000">2000</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2001" href="#L2001">2001</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2002" href="#L2002">2002</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> valueToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L2003" href="#L2003">2003</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L2004" href="#L2004">2004</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2005" href="#L2005">2005</a>         }
-<a class="jxr_linenumber" name="L2006" href="#L2006">2006</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L2007" href="#L2007">2007</a>             startIndex = 0;
-<a class="jxr_linenumber" name="L2008" href="#L2008">2008</a>         }
-<a class="jxr_linenumber" name="L2009" href="#L2009">2009</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &lt; array.length; i++) {
-<a class="jxr_linenumber" name="L2010" href="#L2010">2010</a>             <strong class="jxr_keyword">if</strong> (valueToFind == array[i]) {
-<a class="jxr_linenumber" name="L2011" href="#L2011">2011</a>                 <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L2012" href="#L2012">2012</a>             }
-<a class="jxr_linenumber" name="L2013" href="#L2013">2013</a>         }
-<a class="jxr_linenumber" name="L2014" href="#L2014">2014</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2015" href="#L2015">2015</a>     }
-<a class="jxr_linenumber" name="L2016" href="#L2016">2016</a> 
-<a class="jxr_linenumber" name="L2017" href="#L2017">2017</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2018" href="#L2018">2018</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given value within the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2019" href="#L2019">2019</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2020" href="#L2020">2020</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2021" href="#L2021">2021</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2022" href="#L2022">2022</a> <em class="jxr_javadoccomment">     * @param array  the array to travers backwords looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2023" href="#L2023">2023</a> <em class="jxr_javadoccomment">     * @param valueToFind  the object to find</em>
-<a class="jxr_linenumber" name="L2024" href="#L2024">2024</a> <em class="jxr_javadoccomment">     * @return the last index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2025" href="#L2025">2025</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2026" href="#L2026">2026</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2027" href="#L2027">2027</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2028" href="#L2028">2028</a>         <strong class="jxr_keyword">return</strong> lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
-<a class="jxr_linenumber" name="L2029" href="#L2029">2029</a>     }
-<a class="jxr_linenumber" name="L2030" href="#L2030">2030</a> 
-<a class="jxr_linenumber" name="L2031" href="#L2031">2031</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2032" href="#L2032">2032</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given value in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2033" href="#L2033">2033</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2034" href="#L2034">2034</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2035" href="#L2035">2035</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2036" href="#L2036">2036</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the</em>
-<a class="jxr_linenumber" name="L2037" href="#L2037">2037</a> <em class="jxr_javadoccomment">     * array length will search from the end of the array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1911" href="#L1911">1911</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1912" href="#L1912">1912</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1913" href="#L1913">1913</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1914" href="#L1914">1914</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1915" href="#L1915">1915</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1916" href="#L1916">1916</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1917" href="#L1917">1917</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1918" href="#L1918">1918</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1919" href="#L1919">1919</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1920" href="#L1920">1920</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1921" href="#L1921">1921</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L1922" href="#L1922">1922</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L1923" href="#L1923">1923</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L1924" href="#L1924">1924</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L1925" href="#L1925">1925</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L1926" href="#L1926">1926</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L1927" href="#L1927">1927</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L1928" href="#L1928">1928</a>         }
+<a class="jxr_linenumber" name="L1929" href="#L1929">1929</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L1930" href="#L1930">1930</a>     }
+<a class="jxr_linenumber" name="L1931" href="#L1931">1931</a> 
+<a class="jxr_linenumber" name="L1932" href="#L1932">1932</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L1933" href="#L1933">1933</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1934" href="#L1934">1934</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1935" href="#L1935">1935</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1936" href="#L1936">1936</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1937" href="#L1937">1937</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1938" href="#L1938">1938</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1939" href="#L1939">1939</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1940" href="#L1940">1940</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1941" href="#L1941">1941</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1942" href="#L1942">1942</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1943" href="#L1943">1943</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1944" href="#L1944">1944</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1945" href="#L1945">1945</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L1946" href="#L1946">1946</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1947" href="#L1947">1947</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L1948" href="#L1948">1948</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L1949" href="#L1949">1949</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L1950" href="#L1950">1950</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L1951" href="#L1951">1951</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">short</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L1952" href="#L1952">1952</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L1953" href="#L1953">1953</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L1954" href="#L1954">1954</a>         }
+<a class="jxr_linenumber" name="L1955" href="#L1955">1955</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L1956" href="#L1956">1956</a>     }
+<a class="jxr_linenumber" name="L1957" href="#L1957">1957</a> 
+<a class="jxr_linenumber" name="L1958" href="#L1958">1958</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L1959" href="#L1959">1959</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1960" href="#L1960">1960</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1961" href="#L1961">1961</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1962" href="#L1962">1962</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L1963" href="#L1963">1963</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1964" href="#L1964">1964</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1965" href="#L1965">1965</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1966" href="#L1966">1966</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1967" href="#L1967">1967</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1968" href="#L1968">1968</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1969" href="#L1969">1969</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1970" href="#L1970">1970</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1971" href="#L1971">1971</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1972" href="#L1972">1972</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1973" href="#L1973">1973</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L1974" href="#L1974">1974</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L1975" href="#L1975">1975</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L1976" href="#L1976">1976</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L1977" href="#L1977">1977</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">char</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L1978" href="#L1978">1978</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L1979" href="#L1979">1979</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L1980" href="#L1980">1980</a>         }
+<a class="jxr_linenumber" name="L1981" href="#L1981">1981</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L1982" href="#L1982">1982</a>     }
+<a class="jxr_linenumber" name="L1983" href="#L1983">1983</a> 
+<a class="jxr_linenumber" name="L1984" href="#L1984">1984</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L1985" href="#L1985">1985</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1986" href="#L1986">1986</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1987" href="#L1987">1987</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1988" href="#L1988">1988</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L1989" href="#L1989">1989</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L1990" href="#L1990">1990</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L1991" href="#L1991">1991</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1992" href="#L1992">1992</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1993" href="#L1993">1993</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1994" href="#L1994">1994</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L1995" href="#L1995">1995</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L1996" href="#L1996">1996</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L1997" href="#L1997">1997</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L1998" href="#L1998">1998</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L1999" href="#L1999">1999</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L2000" href="#L2000">2000</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L2001" href="#L2001">2001</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L2002" href="#L2002">2002</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L2003" href="#L2003">2003</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> byte[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L2004" href="#L2004">2004</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L2005" href="#L2005">2005</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L2006" href="#L2006">2006</a>         }
+<a class="jxr_linenumber" name="L2007" href="#L2007">2007</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L2008" href="#L2008">2008</a>     }
+<a class="jxr_linenumber" name="L2009" href="#L2009">2009</a> 
+<a class="jxr_linenumber" name="L2010" href="#L2010">2010</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L2011" href="#L2011">2011</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2012" href="#L2012">2012</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L2013" href="#L2013">2013</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2014" href="#L2014">2014</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L2015" href="#L2015">2015</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L2016" href="#L2016">2016</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L2017" href="#L2017">2017</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2018" href="#L2018">2018</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2019" href="#L2019">2019</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2020" href="#L2020">2020</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2021" href="#L2021">2021</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L2022" href="#L2022">2022</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2023" href="#L2023">2023</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2024" href="#L2024">2024</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L2025" href="#L2025">2025</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L2026" href="#L2026">2026</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L2027" href="#L2027">2027</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L2028" href="#L2028">2028</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L2029" href="#L2029">2029</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L2030" href="#L2030">2030</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L2031" href="#L2031">2031</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L2032" href="#L2032">2032</a>         }
+<a class="jxr_linenumber" name="L2033" href="#L2033">2033</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L2034" href="#L2034">2034</a>     }
+<a class="jxr_linenumber" name="L2035" href="#L2035">2035</a> 
+<a class="jxr_linenumber" name="L2036" href="#L2036">2036</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L2037" href="#L2037">2037</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
 <a class="jxr_linenumber" name="L2038" href="#L2038">2038</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2039" href="#L2039">2039</a> <em class="jxr_javadoccomment">     * @param array  the array to traverse for looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2040" href="#L2040">2040</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2041" href="#L2041">2041</a> <em class="jxr_javadoccomment">     * @param startIndex  the start index to travers backwards from</em>
-<a class="jxr_linenumber" name="L2042" href="#L2042">2042</a> <em class="jxr_javadoccomment">     * @return the last index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2043" href="#L2043">2043</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2044" href="#L2044">2044</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2045" href="#L2045">2045</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> valueToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L2046" href="#L2046">2046</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L2047" href="#L2047">2047</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2048" href="#L2048">2048</a>         }
-<a class="jxr_linenumber" name="L2049" href="#L2049">2049</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L2050" href="#L2050">2050</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2051" href="#L2051">2051</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (startIndex &gt;= array.length) {
-<a class="jxr_linenumber" name="L2052" href="#L2052">2052</a>             startIndex = array.length - 1;
-<a class="jxr_linenumber" name="L2053" href="#L2053">2053</a>         }
-<a class="jxr_linenumber" name="L2054" href="#L2054">2054</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &gt;= 0; i--) {
-<a class="jxr_linenumber" name="L2055" href="#L2055">2055</a>             <strong class="jxr_keyword">if</strong> (valueToFind == array[i]) {
-<a class="jxr_linenumber" name="L2056" href="#L2056">2056</a>                 <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L2057" href="#L2057">2057</a>             }
+<a class="jxr_linenumber" name="L2039" href="#L2039">2039</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2040" href="#L2040">2040</a> <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="L2041" href="#L2041">2041</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L2042" href="#L2042">2042</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L2043" href="#L2043">2043</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2044" href="#L2044">2044</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2045" href="#L2045">2045</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2046" href="#L2046">2046</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2047" href="#L2047">2047</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L2048" href="#L2048">2048</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2049" href="#L2049">2049</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2050" href="#L2050">2050</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L2051" href="#L2051">2051</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L2052" href="#L2052">2052</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L2053" href="#L2053">2053</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L2054" href="#L2054">2054</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L2055" href="#L2055">2055</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">float</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L2056" href="#L2056">2056</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L2057" href="#L2057">2057</a>             <strong class="jxr_keyword">return</strong>;
 <a class="jxr_linenumber" name="L2058" href="#L2058">2058</a>         }
-<a class="jxr_linenumber" name="L2059" href="#L2059">2059</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
+<a class="jxr_linenumber" name="L2059" href="#L2059">2059</a>         swap(array, offset1, offset2, 1);
 <a class="jxr_linenumber" name="L2060" href="#L2060">2060</a>     }
 <a class="jxr_linenumber" name="L2061" href="#L2061">2061</a> 
 <a class="jxr_linenumber" name="L2062" href="#L2062">2062</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2063" href="#L2063">2063</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Checks if the value is in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2063" href="#L2063">2063</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps two elements in the given array.&lt;/p&gt;</em>
 <a class="jxr_linenumber" name="L2064" href="#L2064">2064</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2065" href="#L2065">2065</a> <em class="jxr_javadoccomment">     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2065" href="#L2065">2065</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
 <a class="jxr_linenumber" name="L2066" href="#L2066">2066</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2067" href="#L2067">2067</a> <em class="jxr_javadoccomment">     * @param array  the array to search through</em>
-<a class="jxr_linenumber" name="L2068" href="#L2068">2068</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2069" href="#L2069">2069</a> <em class="jxr_javadoccomment">     * @return {@code true} if the array contains the object</em>
-<a class="jxr_linenumber" name="L2070" href="#L2070">2070</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2071" href="#L2071">2071</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2072" href="#L2072">2072</a>         <strong class="jxr_keyword">return</strong> indexOf(array, valueToFind) != INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2073" href="#L2073">2073</a>     }
-<a class="jxr_linenumber" name="L2074" href="#L2074">2074</a> 
-<a class="jxr_linenumber" name="L2075" href="#L2075">2075</a>     <em class="jxr_comment">// int IndexOf</em>
-<a class="jxr_linenumber" name="L2076" href="#L2076">2076</a>     <em class="jxr_comment">//-----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L2077" href="#L2077">2077</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2078" href="#L2078">2078</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2079" href="#L2079">2079</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2080" href="#L2080">2080</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2081" href="#L2081">2081</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2082" href="#L2082">2082</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2083" href="#L2083">2083</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2084" href="#L2084">2084</a> <em class="jxr_javadoccomment">     * @return the index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2085" href="#L2085">2085</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2086" href="#L2086">2086</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2087" href="#L2087">2087</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2088" href="#L2088">2088</a>         <strong class="jxr_keyword">return</strong> indexOf(array, valueToFind, 0);
-<a class="jxr_linenumber" name="L2089" href="#L2089">2089</a>     }
-<a class="jxr_linenumber" name="L2090" href="#L2090">2090</a> 
-<a class="jxr_linenumber" name="L2091" href="#L2091">2091</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2092" href="#L2092">2092</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2093" href="#L2093">2093</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2094" href="#L2094">2094</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2095" href="#L2095">2095</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2096" href="#L2096">2096</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array</em>
-<a class="jxr_linenumber" name="L2097" href="#L2097">2097</a> <em class="jxr_javadoccomment">     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2098" href="#L2098">2098</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2099" href="#L2099">2099</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2100" href="#L2100">2100</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2101" href="#L2101">2101</a> <em class="jxr_javadoccomment">     * @param startIndex  the index to start searching at</em>
-<a class="jxr_linenumber" name="L2102" href="#L2102">2102</a> <em class="jxr_javadoccomment">     * @return the index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2103" href="#L2103">2103</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2104" href="#L2104">2104</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2105" href="#L2105">2105</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> valueToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L2106" href="#L2106">2106</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L2107" href="#L2107">2107</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2108" href="#L2108">2108</a>         }
-<a class="jxr_linenumber" name="L2109" href="#L2109">2109</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L2110" href="#L2110">2110</a>             startIndex = 0;
+<a class="jxr_linenumber" name="L2067" href="#L2067">2067</a> <em class="jxr_javadoccomment">      * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L2068" href="#L2068">2068</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L2069" href="#L2069">2069</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 2) -&gt; [3, 2, 1]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2070" href="#L2070">2070</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 0) -&gt; [1, 2, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2071" href="#L2071">2071</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 1, 0) -&gt; [2, 1, 3]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2072" href="#L2072">2072</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap([1, 2, 3], 0, 5) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2073" href="#L2073">2073</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L2074" href="#L2074">2074</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2075" href="#L2075">2075</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2076" href="#L2076">2076</a> <em class="jxr_javadoccomment">     * @param array  the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L2077" href="#L2077">2077</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element to swap</em>
+<a class="jxr_linenumber" name="L2078" href="#L2078">2078</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element to swap</em>
+<a class="jxr_linenumber" name="L2079" href="#L2079">2079</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices is out of range</em>
+<a class="jxr_linenumber" name="L2080" href="#L2080">2080</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L2081" href="#L2081">2081</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong>[] array, <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2) {
+<a class="jxr_linenumber" name="L2082" href="#L2082">2082</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L2083" href="#L2083">2083</a>             <strong class="jxr_keyword">return</strong>;
+<a class="jxr_linenumber" name="L2084" href="#L2084">2084</a>         }
+<a class="jxr_linenumber" name="L2085" href="#L2085">2085</a>         swap(array, offset1, offset2, 1);
+<a class="jxr_linenumber" name="L2086" href="#L2086">2086</a>     }
+<a class="jxr_linenumber" name="L2087" href="#L2087">2087</a> 
+<a class="jxr_linenumber" name="L2088" href="#L2088">2088</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="L2089" href="#L2089">2089</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Swaps a series of elements in the given array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2090" href="#L2090">2090</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2091" href="#L2091">2091</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method does nothing for a {@code null} input array.&lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2092" href="#L2092">2092</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2093" href="#L2093">2093</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Examples:</em>
+<a class="jxr_linenumber" name="L2094" href="#L2094">2094</a> <em class="jxr_javadoccomment">     *     &lt;ul&gt;</em>
+<a class="jxr_linenumber" name="L2095" href="#L2095">2095</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 2, 1) -&gt; ["3", "2", "1", "4"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2096" href="#L2096">2096</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 0, 1) -&gt; ["1", "2", "3", "4"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2097" href="#L2097">2097</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 2, 0, 2) -&gt; ["3", "4", "1", "2"]&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2098" href="#L2098">2098</a> <em class="jxr_javadoccomment">     *         &lt;li&gt;ArrayUtils.swap(["1", "2", "3", "4"], 0, 3, 3) -&gt; ArrayOutOfBoundsException&lt;/li&gt;</em>
+<a class="jxr_linenumber" name="L2099" href="#L2099">2099</a> <em class="jxr_javadoccomment">     *     &lt;/ul&gt;</em>
+<a class="jxr_linenumber" name="L2100" href="#L2100">2100</a> <em class="jxr_javadoccomment">     * &lt;/p&gt;</em>
+<a class="jxr_linenumber" name="L2101" href="#L2101">2101</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L2102" href="#L2102">2102</a> <em class="jxr_javadoccomment">     * @param array the array to swap, may be {@code null}</em>
+<a class="jxr_linenumber" name="L2103" href="#L2103">2103</a> <em class="jxr_javadoccomment">     * @param offset1 the index of the first element in the series to swap</em>
+<a class="jxr_linenumber" name="L2104" href="#L2104">2104</a> <em class="jxr_javadoccomment">     * @param offset2 the index of the second element in the series to swap</em>
+<a class="jxr_linenumber" name="L2105" href="#L2105">2105</a> <em class="jxr_javadoccomment">     * @param len the number of elements to swap starting with the given indices</em>
+<a class="jxr_linenumber" name="L2106" href="#L2106">2106</a> <em class="jxr_javadoccomment">     * @throws ArrayIndexOutOfBoundsException if one of the indices (plus the length of the series to swap) is out of range</em>
+<a class="jxr_linenumber" name="L2107" href="#L2107">2107</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="L2108" href="#L2108">2108</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> swap(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">boolean</strong>[] array,  <strong class="jxr_keyword">int</strong> offset1, <strong class="jxr_keyword">int</strong> offset2, <strong class="jxr_keyword">int</strong> len) {
+<a class="jxr_linenumber" name="L2109" href="#L2109">2109</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
+<a class="jxr_linenumber" name="L2110" href="#L2110">2110</a>             <strong class="jxr_keyword">return</strong>;
 <a class="jxr_linenumber" name="L2111" href="#L2111">2111</a>         }
-<a class="jxr_linenumber" name="L2112" href="#L2112">2112</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &lt; array.length; i++) {
-<a class="jxr_linenumber" name="L2113" href="#L2113">2113</a>             <strong class="jxr_keyword">if</strong> (valueToFind == array[i]) {
-<a class="jxr_linenumber" name="L2114" href="#L2114">2114</a>                 <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L2115" href="#L2115">2115</a>             }
-<a class="jxr_linenumber" name="L2116" href="#L2116">2116</a>         }
-<a class="jxr_linenumber" name="L2117" href="#L2117">2117</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2118" href="#L2118">2118</a>     }
-<a class="jxr_linenumber" name="L2119" href="#L2119">2119</a> 
-<a class="jxr_linenumber" name="L2120" href="#L2120">2120</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2121" href="#L2121">2121</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given value within the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2122" href="#L2122">2122</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2123" href="#L2123">2123</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2124" href="#L2124">2124</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2125" href="#L2125">2125</a> <em class="jxr_javadoccomment">     * @param array  the array to travers backwords looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2126" href="#L2126">2126</a> <em class="jxr_javadoccomment">     * @param valueToFind  the object to find</em>
-<a class="jxr_linenumber" name="L2127" href="#L2127">2127</a> <em class="jxr_javadoccomment">     * @return the last index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2128" href="#L2128">2128</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2129" href="#L2129">2129</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2130" href="#L2130">2130</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2131" href="#L2131">2131</a>         <strong class="jxr_keyword">return</strong> lastIndexOf(array, valueToFind, Integer.MAX_VALUE);
-<a class="jxr_linenumber" name="L2132" href="#L2132">2132</a>     }
-<a class="jxr_linenumber" name="L2133" href="#L2133">2133</a> 
-<a class="jxr_linenumber" name="L2134" href="#L2134">2134</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2135" href="#L2135">2135</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the last index of the given value in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2136" href="#L2136">2136</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2137" href="#L2137">2137</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2138" href="#L2138">2138</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2139" href="#L2139">2139</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than the</em>
-<a class="jxr_linenumber" name="L2140" href="#L2140">2140</a> <em class="jxr_javadoccomment">     * array length will search from the end of the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2141" href="#L2141">2141</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2142" href="#L2142">2142</a> <em class="jxr_javadoccomment">     * @param array  the array to traverse for looking for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2143" href="#L2143">2143</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2144" href="#L2144">2144</a> <em class="jxr_javadoccomment">     * @param startIndex  the start index to travers backwards from</em>
-<a class="jxr_linenumber" name="L2145" href="#L2145">2145</a> <em class="jxr_javadoccomment">     * @return the last index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2146" href="#L2146">2146</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2147" href="#L2147">2147</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2148" href="#L2148">2148</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> lastIndexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> valueToFind, <strong class="jxr_keyword">int</strong> startIndex) {
-<a class="jxr_linenumber" name="L2149" href="#L2149">2149</a>         <strong class="jxr_keyword">if</strong> (array == <strong class="jxr_keyword">null</strong>) {
-<a class="jxr_linenumber" name="L2150" href="#L2150">2150</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2151" href="#L2151">2151</a>         }
-<a class="jxr_linenumber" name="L2152" href="#L2152">2152</a>         <strong class="jxr_keyword">if</strong> (startIndex &lt; 0) {
-<a class="jxr_linenumber" name="L2153" href="#L2153">2153</a>             <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2154" href="#L2154">2154</a>         } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (startIndex &gt;= array.length) {
-<a class="jxr_linenumber" name="L2155" href="#L2155">2155</a>             startIndex = array.length - 1;
-<a class="jxr_linenumber" name="L2156" href="#L2156">2156</a>         }
-<a class="jxr_linenumber" name="L2157" href="#L2157">2157</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = startIndex; i &gt;= 0; i--) {
-<a class="jxr_linenumber" name="L2158" href="#L2158">2158</a>             <strong class="jxr_keyword">if</strong> (valueToFind == array[i]) {
-<a class="jxr_linenumber" name="L2159" href="#L2159">2159</a>                 <strong class="jxr_keyword">return</strong> i;
-<a class="jxr_linenumber" name="L2160" href="#L2160">2160</a>             }
-<a class="jxr_linenumber" name="L2161" href="#L2161">2161</a>         }
-<a class="jxr_linenumber" name="L2162" href="#L2162">2162</a>         <strong class="jxr_keyword">return</strong> INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2163" href="#L2163">2163</a>     }
-<a class="jxr_linenumber" name="L2164" href="#L2164">2164</a> 
-<a class="jxr_linenumber" name="L2165" href="#L2165">2165</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2166" href="#L2166">2166</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Checks if the value is in the given array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2167" href="#L2167">2167</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2168" href="#L2168">2168</a> <em class="jxr_javadoccomment">     * &lt;p&gt;The method returns {@code false} if a {@code null} array is passed in.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2169" href="#L2169">2169</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2170" href="#L2170">2170</a> <em class="jxr_javadoccomment">     * @param array  the array to search through</em>
-<a class="jxr_linenumber" name="L2171" href="#L2171">2171</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2172" href="#L2172">2172</a> <em class="jxr_javadoccomment">     * @return {@code true} if the array contains the object</em>
-<a class="jxr_linenumber" name="L2173" href="#L2173">2173</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2174" href="#L2174">2174</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">boolean</strong> contains(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2175" href="#L2175">2175</a>         <strong class="jxr_keyword">return</strong> indexOf(array, valueToFind) != INDEX_NOT_FOUND;
-<a class="jxr_linenumber" name="L2176" href="#L2176">2176</a>     }
-<a class="jxr_linenumber" name="L2177" href="#L2177">2177</a> 
-<a class="jxr_linenumber" name="L2178" href="#L2178">2178</a>     <em class="jxr_comment">// short IndexOf</em>
-<a class="jxr_linenumber" name="L2179" href="#L2179">2179</a>     <em class="jxr_comment">//-----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L2180" href="#L2180">2180</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2181" href="#L2181">2181</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2182" href="#L2182">2182</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2183" href="#L2183">2183</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2184" href="#L2184">2184</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2185" href="#L2185">2185</a> <em class="jxr_javadoccomment">     * @param array  the array to search through for the object, may be {@code null}</em>
-<a class="jxr_linenumber" name="L2186" href="#L2186">2186</a> <em class="jxr_javadoccomment">     * @param valueToFind  the value to find</em>
-<a class="jxr_linenumber" name="L2187" href="#L2187">2187</a> <em class="jxr_javadoccomment">     * @return the index of the value within the array,</em>
-<a class="jxr_linenumber" name="L2188" href="#L2188">2188</a> <em class="jxr_javadoccomment">     *  {@link #INDEX_NOT_FOUND} ({@code -1}) if not found or {@code null} array input</em>
-<a class="jxr_linenumber" name="L2189" href="#L2189">2189</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L2190" href="#L2190">2190</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">int</strong> indexOf(<strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">short</strong>[] array, <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">short</strong> valueToFind) {
-<a class="jxr_linenumber" name="L2191" href="#L2191">2191</a>         <strong class="jxr_keyword">return</strong> indexOf(array, valueToFind, 0);
-<a class="jxr_linenumber" name="L2192" href="#L2192">2192</a>     }
-<a class="jxr_linenumber" name="L2193" href="#L2193">2193</a> 
-<a class="jxr_linenumber" name="L2194" href="#L2194">2194</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L2195" href="#L2195">2195</a> <em class="jxr_javadoccomment">     * &lt;p&gt;Finds the index of the given value in the array starting at the given index.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2196" href="#L2196">2196</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2197" href="#L2197">2197</a> <em class="jxr_javadoccomment">     * &lt;p&gt;This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2198" href="#L2198">2198</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L2199" href="#L2199">2199</a> <em class="jxr_javadoccomment">     * &lt;p&gt;A negative startIndex is treated as zero. A startIndex larger than the array</em>
-<a class="jxr_linenumber" name="L2200" href="#L2200">2200</a> <em class="jxr_javadoccomment">     * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).&lt;/p&gt;</em>
-<a class="jxr_linenumber" name="L2201" href="#L2201">2201</a> <em class="jxr_javadoccomment">     *</em>

[... 9979 lines stripped ...]


Mime
View raw message