http://git-wip-us.apache.org/repos/asf/commons-lang/blob/ac1c3415/src/main/java/org/apache/commons/lang3/ArrayUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/lang3/ArrayUtils.java b/src/main/java/org/apache/commons/lang3/ArrayUtils.java index b913f20..e8a327e 100644 --- a/src/main/java/org/apache/commons/lang3/ArrayUtils.java +++ b/src/main/java/org/apache/commons/lang3/ArrayUtils.java @@ -32,14 +32,14 @@ import org.apache.commons.lang3.mutable.MutableInt; /** * <p>Operations on arrays, primitive arrays (like {@code int[]}) and - * primitive wrapper arrays (like {@code Integer[]}).</p> + * primitive wrapper arrays (like {@code Integer[]}). * * <p>This class tries to handle {@code null} input gracefully. * An exception will not be thrown for a {@code null} * array input. However, an Object array that contains a {@code null} - * element may throw an exception. Each method documents its behaviour.</p> + * element may throw an exception. Each method documents its behaviour. * - * <p>#ThreadSafe#</p> + * <p>#ThreadSafe# * @since 2.0 */ public class ArrayUtils { @@ -130,10 +130,10 @@ public class ArrayUtils { /** * <p>ArrayUtils instances should NOT be constructed in standard programming. - * Instead, the class should be used as <code>ArrayUtils.clone(new int[] {2})</code>.</p> + * Instead, the class should be used as <code>ArrayUtils.clone(new int[] {2})</code>. * * <p>This constructor is public to permit tools that require a JavaBean instance - * to operate.</p> + * to operate. */ public ArrayUtils() { super(); @@ -146,12 +146,12 @@ public class ArrayUtils { // Basic methods handling multi-dimensional arrays //----------------------------------------------------------------------- /** - * <p>Outputs an array as a String, treating {@code null} as an empty array.</p> + * <p>Outputs an array as a String, treating {@code null} as an empty array. * * <p>Multi-dimensional arrays are handled correctly, including - * multi-dimensional primitive arrays.</p> + * multi-dimensional primitive arrays. * - * <p>The format is that of Java source code, for example <code>{a,b}</code>.</p> + * <p>The format is that of Java source code, for example <code>{a,b}</code>. * * @param array the array to get a toString for, may be {@code null} * @return a String representation of the array, '{}' if null array input @@ -161,12 +161,12 @@ public class ArrayUtils { } /** - * <p>Outputs an array as a String handling {@code null}s.</p> + * <p>Outputs an array as a String handling {@code null}s. * * <p>Multi-dimensional arrays are handled correctly, including - * multi-dimensional primitive arrays.</p> + * multi-dimensional primitive arrays. * - * <p>The format is that of Java source code, for example <code>{a,b}</code>.</p> + * <p>The format is that of Java source code, for example <code>{a,b}</code>. * * @param array the array to get a toString for, may be {@code null} * @param stringIfNull the String to return if the array is {@code null} @@ -180,9 +180,9 @@ public class ArrayUtils { } /** - * <p>Get a hash code for an array handling multi-dimensional arrays correctly.</p> + * <p>Get a hash code for an array handling multi-dimensional arrays correctly. * - * <p>Multi-dimensional primitive arrays are also handled correctly by this method.</p> + * <p>Multi-dimensional primitive arrays are also handled correctly by this method. * * @param array the array to get a hash code for, {@code null} returns zero * @return a hash code for the array @@ -193,9 +193,9 @@ public class ArrayUtils { /** * <p>Compares two arrays, using equals(), handling multi-dimensional arrays - * correctly.</p> + * correctly. * - * <p>Multi-dimensional primitive arrays are also handled correctly by this method.</p> + * <p>Multi-dimensional primitive arrays are also handled correctly by this method. * * @param array1 the left hand array to compare, may be {@code null} * @param array2 the right hand array to compare, may be {@code null} @@ -214,9 +214,9 @@ public class ArrayUtils { * <p>Converts the given array into a {@link java.util.Map}. Each element of the array * must be either a {@link java.util.Map.Entry} or an Array, containing at least two * elements, where the first element is used as key and the second as - * value.</p> + * value. * - * <p>This method can be used to initialize:</p> + * <p>This method can be used to initialize: * <pre> * // Create a Map mapping colors. * Map colorMap = MapUtils.toMap(new String[][] {{ @@ -225,7 +225,7 @@ public class ArrayUtils { * {"BLUE", "#0000FF"}}); * </pre> * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array an array whose elements are either a {@link java.util.Map.Entry} or * an Array containing at least two elements, may be {@code null} @@ -265,9 +265,9 @@ public class ArrayUtils { // Generic array //----------------------------------------------------------------------- /** - * <p>Create a type-safe generic array.</p> + * <p>Create a type-safe generic array. * - * <p>The Java language does not allow an array to be created from a generic type:</p> + * <p>The Java language does not allow an array to be created from a generic type: * * <pre> public static <T> T[] createAnArray(int size) { @@ -279,7 +279,7 @@ public class ArrayUtils { * </pre> * * <p>Therefore new arrays of generic types can be created with this method. - * For example, an array of Strings can be created:</p> + * For example, an array of Strings can be created: * * <pre> String[] array = ArrayUtils.toArray("1", "2"); @@ -287,14 +287,14 @@ public class ArrayUtils { * </pre> * * <p>The method is typically used in scenarios, where the caller itself uses generic types - * that have to be combined into an array.</p> + * that have to be combined into an array. * * <p>Note, this method makes only sense to provide arguments of the same type so that the * compiler can deduce the type of the array itself. While it is possible to select the * type explicitly like in * <code>Number[] array = ArrayUtils.<Number>toArray(Integer.valueOf(42), Double.valueOf(Math.PI))</code>, * there is no real advantage when compared to - * <code>new Number[] {Integer.valueOf(42), Double.valueOf(Math.PI)}</code>.</p> + * <code>new Number[] {Integer.valueOf(42), Double.valueOf(Math.PI)}</code>. * * @param <T> the array's element type * @param items the varargs array items, null allowed @@ -309,12 +309,12 @@ public class ArrayUtils { //----------------------------------------------------------------------- /** * <p>Shallow clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * * <p>The objects in the array are not cloned, thus there is no special - * handling for multi-dimensional arrays.</p> + * handling for multi-dimensional arrays. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param <T> the component type of the array * @param array the array to shallow clone, may be {@code null} @@ -329,9 +329,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -345,9 +345,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -361,9 +361,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -377,9 +377,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -393,9 +393,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -409,9 +409,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -425,9 +425,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -441,9 +441,9 @@ public class ArrayUtils { /** * <p>Clones an array returning a typecast result and handling - * {@code null}.</p> + * {@code null}. * - * <p>This method returns {@code null} for a {@code null} input array.</p> + * <p>This method returns {@code null} for a {@code null} input array. * * @param array the array to clone, may be {@code null} * @return the cloned array, {@code null} if {@code null} input @@ -459,12 +459,13 @@ public class ArrayUtils { //----------------------------------------------------------------------- /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * @param array the array to check for {@code null} or empty * @param type the class representation of the desired array + * @param <T> the class type * @return the same array, {@code public static} empty array if {@code null} * @throws IllegalArgumentException if the type argument is null * @since 3.5 @@ -483,12 +484,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -503,12 +504,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -523,12 +524,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -543,12 +544,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -563,12 +564,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -583,12 +584,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -603,12 +604,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -623,12 +624,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -643,12 +644,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -663,12 +664,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -683,12 +684,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -703,12 +704,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -723,12 +724,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -743,12 +744,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -763,12 +764,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -783,12 +784,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -803,12 +804,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -823,12 +824,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -843,12 +844,12 @@ public class ArrayUtils { /** * <p>Defensive programming technique to change a {@code null} - * reference to an empty one.</p> + * reference to an empty one. * - * <p>This method returns an empty array for a {@code null} input array.</p> + * <p>This method returns an empty array for a {@code null} input array. * * <p>As a memory optimizing technique an empty array passed in will be overridden with - * the empty {@code public static} references in this class.</p> + * the empty {@code public static} references in this class. * * @param array the array to check for {@code null} or empty * @return the same array, {@code public static} empty array if {@code null} or empty input @@ -865,14 +866,14 @@ public class ArrayUtils { //----------------------------------------------------------------------- /** * <p>Produces a new array containing the elements between - * the start and end indices.</p> + * the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * <p>The component type of the subarray is always the same as * that of the input array. Thus, if the input is an array of type - * {@code Date}, the following usage is envisaged:</p> + * {@code Date}, the following usage is envisaged: * * <pre> * Date[] someDates = (Date[])ArrayUtils.subarray(allDates, 2, 5); @@ -918,10 +919,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code long} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -958,10 +959,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code int} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -998,10 +999,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code short} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1038,10 +1039,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code char} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1078,10 +1079,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code byte} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1118,10 +1119,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code double} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1158,10 +1159,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code float} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1198,10 +1199,10 @@ public class ArrayUtils { /** * <p>Produces a new {@code boolean} array containing the elements - * between the start and end indices.</p> + * between the start and end indices. * * <p>The start index is inclusive, the end index exclusive. - * Null array input produces null output.</p> + * Null array input produces null output. * * @param array the array * @param startIndexInclusive the starting index. Undervalue (<0) @@ -1242,7 +1243,7 @@ public class ArrayUtils { * <p>Checks whether two arrays are the same length, treating * {@code null} arrays as length {@code 0}. * - * <p>Any multi-dimensional aspects of the arrays are ignored.</p> + * <p>Any multi-dimensional aspects of the arrays are ignored. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1255,7 +1256,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1268,7 +1269,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1281,7 +1282,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1294,7 +1295,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1307,7 +1308,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1320,7 +1321,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1333,7 +1334,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1346,7 +1347,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same length, treating - * {@code null} arrays as length {@code 0}.</p> + * {@code null} arrays as length {@code 0}. * * @param array1 the first array, may be {@code null} * @param array2 the second array, may be {@code null} @@ -1360,9 +1361,9 @@ public class ArrayUtils { //----------------------------------------------------------------------- /** * <p>Returns the length of the specified array. - * This method can deal with {@code Object} arrays and with primitive arrays.</p> + * This method can deal with {@code Object} arrays and with primitive arrays. * - * <p>If the input array is {@code null}, {@code 0} is returned.</p> + * <p>If the input array is {@code null}, {@code 0} is returned. * * <pre> * ArrayUtils.getLength(null) = 0 @@ -1387,7 +1388,7 @@ public class ArrayUtils { /** * <p>Checks whether two arrays are the same type taking into account - * multi-dimensional arrays.</p> + * multi-dimensional arrays. * * @param array1 the first array, must not be {@code null} * @param array2 the second array, must not be {@code null} @@ -1404,11 +1405,11 @@ public class ArrayUtils { // Reverse //----------------------------------------------------------------------- /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>There is no special handling for multi-dimensional arrays.</p> + * <p>There is no special handling for multi-dimensional arrays. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1420,9 +1421,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1434,9 +1435,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1448,9 +1449,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1462,9 +1463,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1476,9 +1477,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1490,9 +1491,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1504,9 +1505,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1518,9 +1519,9 @@ public class ArrayUtils { } /** - * <p>Reverses the order of the given array.</p> + * <p>Reverses the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to reverse, may be {@code null} */ @@ -1534,11 +1535,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1569,11 +1568,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1604,11 +1601,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1639,11 +1634,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1674,11 +1667,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1709,11 +1700,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1744,11 +1733,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1779,11 +1766,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1814,11 +1799,9 @@ public class ArrayUtils { /** * <p> * Reverses the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to reverse, may be {@code null} @@ -1849,22 +1832,21 @@ public class ArrayUtils { // Swap //----------------------------------------------------------------------- /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * - * <p>There is no special handling for multi-dimensional arrays.</p> + * <p>There is no special handling for multi-dimensional arrays. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap(["1", "2", "3"], 0, 2) -> ["3", "2", "1"]</li> - * <li>ArrayUtils.swap(["1", "2", "3"], 0, 0) -> ["1", "2", "3"]</li> - * <li>ArrayUtils.swap(["1", "2", "3"], 1, 0) -> ["2", "1", "3"]</li> - * <li>ArrayUtils.swap(["1", "2", "3"], 0, 5) -> ["1", "2", "3"]</li> - * <li>ArrayUtils.swap(["1", "2", "3"], -1, 1) -> ["2", "1", "3"]</li> + * <li>ArrayUtils.swap(["1", "2", "3"], 0, 2) -> ["3", "2", "1"]</li> + * <li>ArrayUtils.swap(["1", "2", "3"], 0, 0) -> ["1", "2", "3"]</li> + * <li>ArrayUtils.swap(["1", "2", "3"], 1, 0) -> ["2", "1", "3"]</li> + * <li>ArrayUtils.swap(["1", "2", "3"], 0, 5) -> ["1", "2", "3"]</li> + * <li>ArrayUtils.swap(["1", "2", "3"], -1, 1) -> ["2", "1", "3"]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -1878,22 +1860,21 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * - * <p>There is no special handling for multi-dimensional arrays.</p> + * <p>There is no special handling for multi-dimensional arrays. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([true, false, true], 0, 2) -> [true, false, true]</li> - * <li>ArrayUtils.swap([true, false, true], 0, 0) -> [true, false, true]</li> - * <li>ArrayUtils.swap([true, false, true], 1, 0) -> [false, true, true]</li> - * <li>ArrayUtils.swap([true, false, true], 0, 5) -> [true, false, true]</li> - * <li>ArrayUtils.swap([true, false, true], -1, 1) -> [false, true, true]</li> + * <li>ArrayUtils.swap([true, false, true], 0, 2) -> [true, false, true]</li> + * <li>ArrayUtils.swap([true, false, true], 0, 0) -> [true, false, true]</li> + * <li>ArrayUtils.swap([true, false, true], 1, 0) -> [false, true, true]</li> + * <li>ArrayUtils.swap([true, false, true], 0, 5) -> [true, false, true]</li> + * <li>ArrayUtils.swap([true, false, true], -1, 1) -> [false, true, true]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -1907,20 +1888,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -1934,20 +1914,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -1961,20 +1940,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -1988,20 +1966,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -2015,20 +1992,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -2042,20 +2018,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -2069,20 +2044,19 @@ public class ArrayUtils { } /** - * <p>Swaps two elements in the given array.</p> + * <p>Swaps two elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. - * Negative indices are promoted to 0(zero).</p> + * Negative indices are promoted to 0(zero). * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> - * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 2) -> [3, 2, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 0) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 1, 0) -> [2, 1, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], 0, 5) -> [1, 2, 3]</li> + * <li>ArrayUtils.swap([1, 2, 3], -1, 1) -> [2, 1, 3]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element to swap @@ -2096,23 +2070,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([true, false, true, false], 0, 2, 1) -> [true, false, true, false]</li> - * <li>ArrayUtils.swap([true, false, true, false], 0, 0, 1) -> [true, false, true, false]</li> - * <li>ArrayUtils.swap([true, false, true, false], 0, 2, 2) -> [true, false, true, false]</li> - * <li>ArrayUtils.swap([true, false, true, false], -3, 2, 2) -> [true, false, true, false]</li> - * <li>ArrayUtils.swap([true, false, true, false], 0, 3, 3) -> [false, false, true, true]</li> + * <li>ArrayUtils.swap([true, false, true, false], 0, 2, 1) -> [true, false, true, false]</li> + * <li>ArrayUtils.swap([true, false, true, false], 0, 0, 1) -> [true, false, true, false]</li> + * <li>ArrayUtils.swap([true, false, true, false], 0, 2, 2) -> [true, false, true, false]</li> + * <li>ArrayUtils.swap([true, false, true, false], -3, 2, 2) -> [true, false, true, false]</li> + * <li>ArrayUtils.swap([true, false, true, false], 0, 3, 3) -> [false, false, true, true]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2138,23 +2110,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2181,23 +2151,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2223,23 +2191,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2265,23 +2231,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2308,23 +2272,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2350,23 +2312,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2392,23 +2352,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 2, 1) -> ["3", "2", "1", "4"]</li> - * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 0, 1) -> ["1", "2", "3", "4"]</li> - * <li>ArrayUtils.swap(["1", "2", "3", "4"], 2, 0, 2) -> ["3", "4", "1", "2"]</li> - * <li>ArrayUtils.swap(["1", "2", "3", "4"], -3, 2, 2) -> ["3", "4", "1", "2"]</li> - * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 3, 3) -> ["4", "2", "3", "1"]</li> + * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 2, 1) -> ["3", "2", "1", "4"]</li> + * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 0, 1) -> ["1", "2", "3", "4"]</li> + * <li>ArrayUtils.swap(["1", "2", "3", "4"], 2, 0, 2) -> ["3", "4", "1", "2"]</li> + * <li>ArrayUtils.swap(["1", "2", "3", "4"], -3, 2, 2) -> ["3", "4", "1", "2"]</li> + * <li>ArrayUtils.swap(["1", "2", "3", "4"], 0, 3, 3) -> ["4", "2", "3", "1"]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2434,23 +2392,21 @@ public class ArrayUtils { } /** - * <p>Swaps a series of elements in the given array.</p> + * <p>Swaps a series of elements in the given array. * * <p>This method does nothing for a {@code null} or empty input array or for overflow indices. * Negative indices are promoted to 0(zero). * If any of the sub-arrays to swap falls outside of the given array, * then the swap is stopped at the end of the array and as many as possible elements are swapped. - * </p> * * <p>Examples: * <ul> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> - * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 2, 1) -> [3, 2, 1, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 0, 1) -> [1, 2, 3, 4]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 2, 0, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], -3, 2, 2) -> [3, 4, 1, 2]</li> + * <li>ArrayUtils.swap([1, 2, 3, 4], 0, 3, 3) -> [4, 2, 3, 1]</li> * </ul> - * </p> * * @param array the array to swap, may be {@code null} * @param offset1 the index of the first element in the series to swap @@ -2481,14 +2437,17 @@ public class ArrayUtils { // Shift //----------------------------------------------------------------------- /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>There is no special handling for multi-dimensional arrays.</p> + * <p>There is no special handling for multi-dimensional arrays. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} * @param offset how many position to the right to shift the array, if negative it will be shiftd to the left. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final Object[] array, int offset) { if (array == null) { @@ -2498,11 +2457,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final long[] array, int offset) { if (array == null) { @@ -2512,11 +2474,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final int[] array, int offset) { if (array == null) { @@ -2526,11 +2491,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final short[] array, int offset) { if (array == null) { @@ -2540,11 +2508,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final char[] array, int offset) { if (array == null) { @@ -2554,11 +2525,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final byte[] array, int offset) { if (array == null) { @@ -2568,11 +2542,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final double[] array, int offset) { if (array == null) { @@ -2582,11 +2559,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final float[] array, int offset) { if (array == null) { @@ -2596,11 +2576,14 @@ public class ArrayUtils { } /** - * <p>Shifts the order of the given array.</p> + * <p>Shifts the order of the given array. * - * <p>This method does nothing for a {@code null} input array.</p> + * <p>This method does nothing for a {@code null} input array. * * @param array the array to shift, may be {@code null} + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final boolean[] array, int offset) { if (array == null) { @@ -2612,11 +2595,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2626,6 +2607,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final boolean[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2672,11 +2656,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2686,6 +2668,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final byte[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2732,11 +2717,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2746,6 +2729,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final char[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2792,11 +2778,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2806,6 +2790,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final double[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2852,11 +2839,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2866,6 +2851,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final float[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2912,11 +2900,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2926,6 +2912,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final int[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -2972,11 +2961,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -2986,6 +2973,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final long[] array, int startIndexInclusive, int endIndexExclusive, int offset) { if (array == null) { @@ -3031,11 +3021,9 @@ public class ArrayUtils { /** * <p> * Shifts the order of the given array in the given range. - * </p> * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -3045,6 +3033,9 @@ public class ArrayUtils { * @param endIndexExclusive * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. */ public static void shift(final Object[] array, int startIndexInclusive, int endIndexExclusive, int offset) { if (array == null) { @@ -3089,12 +3080,10 @@ public class ArrayUtils { /** * <p> - * Shifts the order of the given array in the given range. - * </p> + * Rotate the elements of the given array in the given range. * * <p> * This method does nothing for a {@code null} input array. - * </p> * * @param array * the array to shift, may be {@code null} @@ -3102,8 +3091,11 @@ public class ArrayUtils { * the starting index. Undervalue (<0) is promoted to 0, overvalue (>array.length) results in no * change. * @param endIndexExclusive - * elements up to endIndex-1 are shiftd in the array. Undervalue (< start index) results in no + * elements up to endIndex-1 are shifted in the array. Undervalue (< start index) results in no * change. Overvalue (>array.length) is demoted to array length. + * @param offset + * The number of positions to rotate the elements. If the offset is larger than the number of elements to + * rotate, than the effective offset is modulo the number of elements to rotate. * @since 3.2 */ public static void shift(final short[] array, int startIndexInclusive, int endIndexExclusive, int offset) { @@ -3153,9 +3145,9 @@ public class ArrayUtils { // Object IndexOf //----------------------------------------------------------------------- /** - * <p>Finds the index of the given object in the array.</p> + * <p>Finds the index of the given object in the array. * - * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.</p> + * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. * * @param array the array to search through for the object, may be {@code null} * @param objectToFind the object to find, may be {@code null} @@ -3167,12 +3159,12 @@ public class ArrayUtils { } /** - * <p>Finds the index of the given object in the array starting at the given index.</p> + * <p>Finds the index of the given object in the array starting at the given index. * - * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.</p> + * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. * * <p>A negative startIndex is treated as zero. A startIndex larger than the array - * length will return {@link #INDEX_NOT_FOUND} ({@code -1}).</p> + * length will return {@link #INDEX_NOT_FOUND} ({@code -1}). * * @param array the array to search through for the object, may be {@code null} * @param objectToFind the object to find, may be {@code null} @@ -3204,9 +3196,9 @@ public class ArrayUtils { } /** - * <p>Finds the last index of the given object within the array.</p> + * <p>Finds the last index of the given object within the array. * - * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.</p> + * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. * * @param array the array to travers backwords looking for the object, may be {@code null} * @param objectToFind the object to find, may be {@code null} @@ -3218,12 +3210,12 @@ public class ArrayUtils { } /** - * <p>Finds the last index of the given object in the array starting at the given index.</p> + * <p>Finds the last index of the given object in the array starting at the given index. * - * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array.</p> + * <p>This method returns {@link #INDEX_NOT_FOUND} ({@code -1}) for a {@code null} input array. * * <p>A negative startIndex will return {@link #INDEX_NOT_FOUND} ({@code -1}). A startIndex larger than - * the array length will search from the end of the array.</p> + * the array length wil
<TRUNCATED>
