Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util
Class Arrays

java.lang.Object
  extended by oracle.adfnmc.java.util.Arrays

public class Arrays
extends java.lang.Object

Arrays contains static methods which operate on arrays.

Since:
1.2

Method Summary
static List asList(java.lang.Object[] array)
          Answers a List on the objects in the specified array.
static int binarySearch(byte[] array, byte value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(char[] array, char value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(double[] array, double value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(float[] array, float value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(int[] array, int value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(long[] array, long value)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(java.lang.Object[] array, java.lang.Object object)
          Performs a binary search for the specified element in the specified sorted array.
static int binarySearch(java.lang.Object[] array, java.lang.Object object, Comparator comparator)
          Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements.
static int binarySearch(short[] array, short value)
          Performs a binary search for the specified element in the specified sorted array.
static char[] clone(char[] array)
           
static java.lang.Object[] clone(java.lang.Object[] array)
           
static boolean deepEquals(java.lang.Object[] array1, java.lang.Object[] array2)
          Returns the 'deep' equals for the two given arrays.
static int deepHashCode(java.lang.Object[] array)
          Returns the 'deep' hash code for the given array.
static java.lang.String deepToString(java.lang.Object[] array)
           Creates a "deep" String representation of the Object[] passed, such that if the array contains other arrays, the String representation of those arrays is generated as well.
static boolean equals(boolean[] array1, boolean[] array2)
          Compares the two arrays.
static boolean equals(byte[] array1, byte[] array2)
          Compares the two arrays.
static boolean equals(char[] array1, char[] array2)
          Compares the two arrays.
static boolean equals(double[] array1, double[] array2)
          Compares the two arrays.
static boolean equals(float[] array1, float[] array2)
          Compares the two arrays.
static boolean equals(int[] array1, int[] array2)
          Compares the two arrays.
static boolean equals(long[] array1, long[] array2)
          Compares the two arrays.
static boolean equals(java.lang.Object[] array1, java.lang.Object[] array2)
          Compares the two arrays.
static boolean equals(short[] array1, short[] array2)
          Compares the two arrays.
static void fill(boolean[] array, boolean value)
          Fills the array with the given value.
static void fill(boolean[] array, int start, int end, boolean value)
          Fills the section of the array between the given indices with the given value.
static void fill(byte[] array, byte value)
          Fills the array with the given value.
static void fill(byte[] array, int start, int end, byte value)
          Fills the section of the array between the given indices with the given value.
static void fill(char[] array, char value)
          Fills the array with the given value.
static void fill(char[] array, int start, int end, char value)
          Fills the section of the array between the given indices with the given value.
static void fill(double[] array, double value)
          Fills the array with the given value.
static void fill(double[] array, int start, int end, double value)
          Fills the section of the array between the given indices with the given value.
static void fill(float[] array, float value)
          Fills the array with the given value.
static void fill(float[] array, int start, int end, float value)
          Fills the section of the array between the given indices with the given value.
static void fill(int[] array, int value)
          Fills the array with the given value.
static void fill(int[] array, int start, int end, int value)
          Fills the section of the array between the given indices with the given value.
static void fill(long[] array, int start, int end, long value)
          Fills the section of the array between the given indices with the given value.
static void fill(long[] array, long value)
          Fills the array with the given value.
static void fill(java.lang.Object[] array, int start, int end, java.lang.Object value)
          Fills the section of the array between the given indices with the given value.
static void fill(java.lang.Object[] array, java.lang.Object value)
          Fills the array with the given value.
static void fill(short[] array, int start, int end, short value)
          Fills the section of the array between the given indices with the given value.
static void fill(short[] array, short value)
          Fills the array with the given value.
static int hashCode(boolean[] array)
          Returns the hash code for the given array.
static int hashCode(byte[] array)
          Returns the hash code for the given array.
static int hashCode(char[] array)
          Returns the hash code for the given array.
static int hashCode(double[] array)
          Returns the hash code for the given array.
static int hashCode(float[] array)
          Returns the hash code for the given array.
static int hashCode(int[] array)
          Returns the hash code for the given array.
static int hashCode(long[] array)
          Returns the hash code for the given array.
static int hashCode(java.lang.Object[] array)
          Returns the hash code for the given array.
static int hashCode(short[] array)
          Returns the hash code for the given array.
static void sort(byte[] array)
          Performs a sort on the given array.
static void sort(byte[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(char[] array)
          Performs a sort on the given array.
static void sort(char[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(double[] array)
          Performs a sort on the given array.
static void sort(double[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(float[] array)
          Performs a sort on the given array.
static void sort(float[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(int[] array)
          Performs a sort on the given array.
static void sort(int[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(long[] array)
          Performs a sort on given array.
static void sort(long[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(java.lang.Object[] array)
          Performs a sort on the given array.
static void sort(java.lang.Object[] array, Comparator comparator)
          Performs a sort on the given array.
static void sort(java.lang.Object[] array, int start, int end)
          Performs a sort on the section of the array between the given indices.
static void sort(java.lang.Object[] array, int start, int end, Comparator comparator)
          Performs a sort on the section of the array between the given indices.
static void sort(short[] array)
          Performs a sort on the given array.
static void sort(short[] array, int start, int end)
          Performs a sort on the given array.
static java.lang.String toString(boolean[] array)
           Creates a String representation of the boolean[] passed.
static java.lang.String toString(byte[] array)
          Creates a String representation of the byte[] passed.
static java.lang.String toString(char[] array)
           Creates a String representation of the char[] passed.
static java.lang.String toString(double[] array)
           Creates a String representation of the double[] passed.
static java.lang.String toString(float[] array)
           Creates a String representation of the float[] passed.
static java.lang.String toString(int[] array)
           Creates a String representation of the int[] passed.
static java.lang.String toString(long[] array)
           Creates a String representation of the long[] passed.
static java.lang.String toString(java.lang.Object[] array)
           Creates a String representation of the Object[] passed.
static java.lang.String toString(short[] array)
          Creates a String representation of the short[] passed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

asList

public static List asList(java.lang.Object[] array)
Answers a List on the objects in the specified array. The size of the List cannot be modified, i.e. adding and removing are unsupported, but the elements can be set. Setting an element modifies the underlying array.

Parameters:
array - the array
Returns:
a List on the specified array

binarySearch

public static int binarySearch(byte[] array,
                               byte value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted byte array to search
value - the byte element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(char[] array,
                               char value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted char array to search
value - the char element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(double[] array,
                               double value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted double array to search
value - the double element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(float[] array,
                               float value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted float array to search
value - the float element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(int[] array,
                               int value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted int array to search
value - the int element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(long[] array,
                               long value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted long array to search
value - the long element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

binarySearch

public static int binarySearch(java.lang.Object[] array,
                               java.lang.Object object)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted Object array to search
object - the Object element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
Throws:
java.lang.ClassCastException - when an element in the array or the search element does not implement Comparable, or cannot be compared to each other

binarySearch

public static int binarySearch(java.lang.Object[] array,
                               java.lang.Object object,
                               Comparator comparator)
Performs a binary search for the specified element in the specified sorted array using the Comparator to compare elements.

Parameters:
array - the sorted char array to search
object - the char element to find
comparator - the Comparator
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted
Throws:
java.lang.ClassCastException - when an element in the array and the search element cannot be compared to each other using the Comparator

binarySearch

public static int binarySearch(short[] array,
                               short value)
Performs a binary search for the specified element in the specified sorted array.

Parameters:
array - the sorted short array to search
value - the short element to find
Returns:
the non-negative index of the element, or a negative index which is the -index - 1 where the element would be inserted

fill

public static void fill(byte[] array,
                        byte value)
Fills the array with the given value.

Parameters:
array - the byte array to fill
value - the byte element

fill

public static void fill(byte[] array,
                        int start,
                        int end,
                        byte value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the byte array to fill
start - the start index
end - the end index + 1
value - the byte element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(short[] array,
                        short value)
Fills the array with the given value.

Parameters:
array - the short array to fill
value - the short element

fill

public static void fill(short[] array,
                        int start,
                        int end,
                        short value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the short array to fill
start - the start index
end - the end index + 1
value - the short element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(char[] array,
                        char value)
Fills the array with the given value.

Parameters:
array - the char array to fill
value - the char element

fill

public static void fill(char[] array,
                        int start,
                        int end,
                        char value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the char array to fill
start - the start index
end - the end index + 1
value - the char element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(int[] array,
                        int value)
Fills the array with the given value.

Parameters:
array - the int array to fill
value - the int element

fill

public static void fill(int[] array,
                        int start,
                        int end,
                        int value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the int array to fill
start - the start index
end - the end index + 1
value - the int element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(long[] array,
                        long value)
Fills the array with the given value.

Parameters:
array - the long array to fill
value - the long element

fill

public static void fill(long[] array,
                        int start,
                        int end,
                        long value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the long array to fill
start - the start index
end - the end index + 1
value - the long element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(float[] array,
                        float value)
Fills the array with the given value.

Parameters:
array - the float array to fill
value - the float element

fill

public static void fill(float[] array,
                        int start,
                        int end,
                        float value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the float array to fill
start - the start index
end - the end index + 1
value - the float element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(double[] array,
                        double value)
Fills the array with the given value.

Parameters:
array - the float array to fill
value - the float element

fill

public static void fill(double[] array,
                        int start,
                        int end,
                        double value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the double array to fill
start - the start index
end - the end index + 1
value - the double element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(boolean[] array,
                        boolean value)
Fills the array with the given value.

Parameters:
array - the boolean array to fill
value - the boolean element

fill

public static void fill(boolean[] array,
                        int start,
                        int end,
                        boolean value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the boolean array to fill
start - the start index
end - the end index + 1
value - the boolean element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

fill

public static void fill(java.lang.Object[] array,
                        java.lang.Object value)
Fills the array with the given value.

Parameters:
array - the Object array to fill
value - the Object element

fill

public static void fill(java.lang.Object[] array,
                        int start,
                        int end,
                        java.lang.Object value)
Fills the section of the array between the given indices with the given value.

Parameters:
array - the Object array to fill
start - the start index
end - the end index + 1
value - the Object element
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

hashCode

public static int hashCode(boolean[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Boolean instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(int[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Integer instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(short[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Short instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(char[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Character instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(byte[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Byte instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(long[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Long instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(float[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Float instances representing the elements of array in the same order. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(double[] array)
Returns the hash code for the given array. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the List.hashCode() method which is invoked on a List containing a sequence of Double instances representing the elements of array in the same order. If the array is null, the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

hashCode

public static int hashCode(java.lang.Object[] array)
Returns the hash code for the given array. If this array contains other arrays, their contents will not be recursively searched so this method should be used if the array is likely to contain a reference to itself. If Arrays.equals(...) returns true for two arrays then their hash codes will also be equal. The value returned by this method is the same value as the method Arrays.asList(array).hashCode(). If the array is null, the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

deepHashCode

public static int deepHashCode(java.lang.Object[] array)
Returns the 'deep' hash code for the given array. This means that if this array contains other arrays their contents will also be included in the hash and so on recursively. This method should not be used if the array or any arrays contained within it are likely to contain a reference to itself. If Arrays.deepEquals(...) returns true for two arrays then their deep hash codes will also be equal. If the array is null the return value will be 0.

Parameters:
array - the array to return the hash code for
Returns:
the hash code for array

equals

public static boolean equals(byte[] array1,
                             byte[] array2)
Compares the two arrays.

Parameters:
array1 - the first byte array
array2 - the second byte array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(short[] array1,
                             short[] array2)
Compares the two arrays.

Parameters:
array1 - the first short array
array2 - the second short array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(char[] array1,
                             char[] array2)
Compares the two arrays.

Parameters:
array1 - the first char array
array2 - the second char array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(int[] array1,
                             int[] array2)
Compares the two arrays.

Parameters:
array1 - the first int array
array2 - the second int array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(long[] array1,
                             long[] array2)
Compares the two arrays.

Parameters:
array1 - the first long array
array2 - the second long array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(float[] array1,
                             float[] array2)
Compares the two arrays. The values are compared in the same manner as Float.equals().

Parameters:
array1 - the first float array
array2 - the second float array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise
See Also:
Float.equals(Object)

equals

public static boolean equals(double[] array1,
                             double[] array2)
Compares the two arrays. The values are compared in the same manner as Double.equals().

Parameters:
array1 - the first double array
array2 - the second double array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise
See Also:
Double.equals(Object)

equals

public static boolean equals(boolean[] array1,
                             boolean[] array2)
Compares the two arrays.

Parameters:
array1 - the first boolean array
array2 - the second boolean array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

equals

public static boolean equals(java.lang.Object[] array1,
                             java.lang.Object[] array2)
Compares the two arrays.

Parameters:
array1 - the first Object array
array2 - the second Object array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

deepEquals

public static boolean deepEquals(java.lang.Object[] array1,
                                 java.lang.Object[] array2)
Returns the 'deep' equals for the two given arrays. This means that if either of the arrays contains other arrays then their contents are also checked for (deep) equality. If two corresponding elements are arrays of a primitive type then the appropriate Arrays.equals method is used to determine their equality. Otherwise for two Object arrays deepEquals is called recursively. This method should not be used if either of the arrays, or any arrays contained within it are likely to contain a reference to itself.

Parameters:
array1 - the first Object array
array2 - the second Object array
Returns:
true when the arrays have the same length and the elements at each index in the two arrays are equal, false otherwise

sort

public static void sort(byte[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the byte array to sort

sort

public static void sort(byte[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the byte array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(char[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the char array to sort

sort

public static void sort(char[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the char array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(double[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the double array to sort
See Also:
sort(double[], int, int)

sort

public static void sort(double[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the double array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()
See Also:
Double#compareTo(Double)

sort

public static void sort(float[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the float array to sort
See Also:
sort(float[], int, int)

sort

public static void sort(float[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the float array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()
See Also:
Float#compareTo(Float)

sort

public static void sort(int[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the int array to sort

sort

public static void sort(int[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the int array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(long[] array)
Performs a sort on given array. Elements will be re-ordered into ascending order.

Parameters:
array - the long array to sort

sort

public static void sort(long[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the long array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(java.lang.Object[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the Object array to sort
Throws:
java.lang.ClassCastException - when an element in the array does not implement Comparable or elements cannot be compared to each other

sort

public static void sort(java.lang.Object[] array,
                        int start,
                        int end)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order.

Parameters:
array - the Object array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.ClassCastException - when an element in the array does not implement Comparable or elements cannot be compared to each other
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(java.lang.Object[] array,
                        int start,
                        int end,
                        Comparator comparator)
Performs a sort on the section of the array between the given indices. Elements will be re-ordered into ascending order according to the given Comparator.

Parameters:
array - the Object array to sort
start - the start index
end - the end index + 1
comparator - the Comparator
Throws:
java.lang.ClassCastException - when elements in the array cannot be compared to each other using the Comparator
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

sort

public static void sort(java.lang.Object[] array,
                        Comparator comparator)
Performs a sort on the given array. Elements will be re-ordered into ascending order according to the given Comparator.

Parameters:
array - the Object array to sort
comparator - the Comparator
Throws:
java.lang.ClassCastException - when elements in the array cannot be compared to each other using the Comparator

sort

public static void sort(short[] array)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the short array to sort

sort

public static void sort(short[] array,
                        int start,
                        int end)
Performs a sort on the given array. Elements will be re-ordered into ascending order.

Parameters:
array - the short array to sort
start - the start index
end - the end index + 1
Throws:
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0 or end > array.size()

toString

public static java.lang.String toString(boolean[] array)

Creates a String representation of the boolean[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(boolean) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The boolean array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(byte[] array)
Creates a String representation of the byte[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(int) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The byte array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(char[] array)

Creates a String representation of the char[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(char) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The char array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(double[] array)

Creates a String representation of the double[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(double) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The double array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(float[] array)

Creates a String representation of the float[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(float) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The float array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(int[] array)

Creates a String representation of the int[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(int) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The int array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(long[] array)

Creates a String representation of the long[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(long) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The long array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(short[] array)
Creates a String representation of the short[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(int) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The short array to convert.
Returns:
The String representation of array.
Since:
1.5

toString

public static java.lang.String toString(java.lang.Object[] array)

Creates a String representation of the Object[] passed. The result is surrounded by brackets ("[]"), each element is converted to a String via the String.valueOf(Object) and separated by ", ". If the array is null, then "null" is returned.

Parameters:
array - The Object array to convert.
Returns:
The String representation of array.
Since:
1.5

deepToString

public static java.lang.String deepToString(java.lang.Object[] array)

Creates a "deep" String representation of the Object[] passed, such that if the array contains other arrays, the String representation of those arrays is generated as well.

If any of the elements are primitive arrays, the generation is delegated to the other toString methods in this class. If any element contains a reference to the original array, then it will be represented as "[...]". If an element is an Object[], then its representation is generated by a recursive call to this method. All other elements are converted via the String.valueOf(Object) method.

Parameters:
array - The Object array to convert.
Returns:
The String representation of array.
Since:
1.5

clone

public static java.lang.Object[] clone(java.lang.Object[] array)

clone

public static char[] clone(char[] array)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.