| java.lang.Object org.drools.util.ArrayUtils
ArrayUtils | public class ArrayUtils (Code) | | Taken from commons lang
Operations on arrays, primitive arrays (like int[] ) and
primitive wrapper arrays (like Integer[] ).
This class tries to handle null input gracefully.
An exception will not be thrown for a null
array input. However, an Object array that contains a null
element may throw an exception. Each method documents its behaviour.
author: Stephen Colebourne author: Moritz Petersen author: Fredrik Westermarck author: Nikolay Metchev author: Matthew Hawthorne author: Tim O'Brien author: Pete Gieser author: Gary Gregory author: Ashwin S author: Maarten Coene since: 2.0 version: $Id$ |
Method Summary | |
public static boolean | contains(Object[] array, Object objectToFind) | public static Object[] | copyOf(Object[] original, int newLength, Class newType) | public static boolean | deepEquals(Object[] a1, Object[] a2) | public static boolean | equals(long[] a, long[] a2) | public static boolean | equals(int[] a, int[] a2) | public static boolean | equals(short[] a, short a2) | public static boolean | equals(char[] a, char[] a2) | public static boolean | equals(byte[] a, byte[] a2) | public static boolean | equals(boolean[] a, boolean[] a2) | public static boolean | equals(double[] a, double[] a2) | public static boolean | equals(float[] a, float[] a2) | public static boolean | equals(Object[] a, Object[] a2) | public static int | hashCode(Object[] array) | public static int | indexOf(Object[] array, Object objectToFind) | public static int | indexOf(Object[] array, Object objectToFind, int startIndex) Finds the index of the given object in the array starting at the given index.
This method returns
ArrayUtils.INDEX_NOT_FOUND (-1 ) for a null input array.
A negative startIndex is treated as zero. |
INDEX_NOT_FOUND | final public static int INDEX_NOT_FOUND(Code) | | |
contains | public static boolean contains(Object[] array, Object objectToFind)(Code) | | Checks if the object is in the given array.
The method returns false if a null array is passed in.
Parameters: array - the array to search through Parameters: objectToFind - the object to find true if the array contains the object |
equals | public static boolean equals(long[] a, long[] a2)(Code) | | |
equals | public static boolean equals(int[] a, int[] a2)(Code) | | |
equals | public static boolean equals(short[] a, short a2)(Code) | | |
equals | public static boolean equals(char[] a, char[] a2)(Code) | | |
equals | public static boolean equals(byte[] a, byte[] a2)(Code) | | |
equals | public static boolean equals(boolean[] a, boolean[] a2)(Code) | | |
equals | public static boolean equals(double[] a, double[] a2)(Code) | | |
equals | public static boolean equals(float[] a, float[] a2)(Code) | | |
indexOf | public static int indexOf(Object[] array, Object objectToFind)(Code) | | Finds the index of the given object in the array.
This method returns
ArrayUtils.INDEX_NOT_FOUND (-1 ) for a null input array.
Parameters: array - the array to search through for the object, may be null Parameters: objectToFind - the object to find, may be null the index of the object within the array, ArrayUtils.INDEX_NOT_FOUND (-1 ) if not found or null array input |
indexOf | public static int indexOf(Object[] array, Object objectToFind, int startIndex)(Code) | | Finds the index of the given object in the array starting at the given index.
This method returns
ArrayUtils.INDEX_NOT_FOUND (-1 ) for a null input array.
A negative startIndex is treated as zero. A startIndex larger than the array
length will return
ArrayUtils.INDEX_NOT_FOUND (-1 ).
Parameters: array - the array to search through for the object, may be null Parameters: objectToFind - the object to find, may be null Parameters: startIndex - the index to start searching at the index of the object within the array starting at the index,ArrayUtils.INDEX_NOT_FOUND (-1 ) if not found or null array input |
|
|