|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.adfnmc.java.util.Arrays
public class Arrays
Arrays contains static methods which operate on arrays.
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 |
---|
public static List asList(java.lang.Object[] array)
array
- the array
public static int binarySearch(byte[] array, byte value)
array
- the sorted byte array to searchvalue
- the byte element to find
public static int binarySearch(char[] array, char value)
array
- the sorted char array to searchvalue
- the char element to find
public static int binarySearch(double[] array, double value)
array
- the sorted double array to searchvalue
- the double element to find
public static int binarySearch(float[] array, float value)
array
- the sorted float array to searchvalue
- the float element to find
public static int binarySearch(int[] array, int value)
array
- the sorted int array to searchvalue
- the int element to find
public static int binarySearch(long[] array, long value)
array
- the sorted long array to searchvalue
- the long element to find
public static int binarySearch(java.lang.Object[] array, java.lang.Object object)
array
- the sorted Object array to searchobject
- the Object element to find
java.lang.ClassCastException
- when an element in the array or the search element does not implement Comparable, or cannot be
compared to each otherpublic static int binarySearch(java.lang.Object[] array, java.lang.Object object, Comparator comparator)
array
- the sorted char array to searchobject
- the char element to findcomparator
- the Comparator
java.lang.ClassCastException
- when an element in the array and the search element cannot be compared to each other using the
Comparatorpublic static int binarySearch(short[] array, short value)
array
- the sorted short array to searchvalue
- the short element to find
public static void fill(byte[] array, byte value)
array
- the byte array to fillvalue
- the byte elementpublic static void fill(byte[] array, int start, int end, byte value)
array
- the byte array to fillstart
- the start indexend
- the end index + 1value
- the byte element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(short[] array, short value)
array
- the short array to fillvalue
- the short elementpublic static void fill(short[] array, int start, int end, short value)
array
- the short array to fillstart
- the start indexend
- the end index + 1value
- the short element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(char[] array, char value)
array
- the char array to fillvalue
- the char elementpublic static void fill(char[] array, int start, int end, char value)
array
- the char array to fillstart
- the start indexend
- the end index + 1value
- the char element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(int[] array, int value)
array
- the int array to fillvalue
- the int elementpublic static void fill(int[] array, int start, int end, int value)
array
- the int array to fillstart
- the start indexend
- the end index + 1value
- the int element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(long[] array, long value)
array
- the long array to fillvalue
- the long elementpublic static void fill(long[] array, int start, int end, long value)
array
- the long array to fillstart
- the start indexend
- the end index + 1value
- the long element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(float[] array, float value)
array
- the float array to fillvalue
- the float elementpublic static void fill(float[] array, int start, int end, float value)
array
- the float array to fillstart
- the start indexend
- the end index + 1value
- the float element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(double[] array, double value)
array
- the float array to fillvalue
- the float elementpublic static void fill(double[] array, int start, int end, double value)
array
- the double array to fillstart
- the start indexend
- the end index + 1value
- the double element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(boolean[] array, boolean value)
array
- the boolean array to fillvalue
- the boolean elementpublic static void fill(boolean[] array, int start, int end, boolean value)
array
- the boolean array to fillstart
- the start indexend
- the end index + 1value
- the boolean element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void fill(java.lang.Object[] array, java.lang.Object value)
array
- the Object array to fillvalue
- the Object elementpublic static void fill(java.lang.Object[] array, int start, int end, java.lang.Object value)
array
- the Object array to fillstart
- the start indexend
- the end index + 1value
- the Object element
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static int hashCode(boolean[] array)
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.
array
- the array to return the hash code for
public static int hashCode(int[] array)
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.
array
- the array to return the hash code for
public static int hashCode(short[] array)
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.
array
- the array to return the hash code for
public static int hashCode(char[] array)
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.
array
- the array to return the hash code for
public static int hashCode(byte[] array)
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.
array
- the array to return the hash code for
public static int hashCode(long[] array)
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.
array
- the array to return the hash code for
public static int hashCode(float[] array)
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.
array
- the array to return the hash code for
public static int hashCode(double[] array)
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.
array
- the array to return the hash code for
public static int hashCode(java.lang.Object[] array)
array
- the array to return the hash code for
public static int deepHashCode(java.lang.Object[] array)
array
- the array to return the hash code for
public static boolean equals(byte[] array1, byte[] array2)
array1
- the first byte arrayarray2
- the second byte array
public static boolean equals(short[] array1, short[] array2)
array1
- the first short arrayarray2
- the second short array
public static boolean equals(char[] array1, char[] array2)
array1
- the first char arrayarray2
- the second char array
public static boolean equals(int[] array1, int[] array2)
array1
- the first int arrayarray2
- the second int array
public static boolean equals(long[] array1, long[] array2)
array1
- the first long arrayarray2
- the second long array
public static boolean equals(float[] array1, float[] array2)
array1
- the first float arrayarray2
- the second float array
Float.equals(Object)
public static boolean equals(double[] array1, double[] array2)
array1
- the first double arrayarray2
- the second double array
Double.equals(Object)
public static boolean equals(boolean[] array1, boolean[] array2)
array1
- the first boolean arrayarray2
- the second boolean array
public static boolean equals(java.lang.Object[] array1, java.lang.Object[] array2)
array1
- the first Object arrayarray2
- the second Object array
public static boolean deepEquals(java.lang.Object[] array1, java.lang.Object[] array2)
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.
array1
- the first Object arrayarray2
- the second Object array
public static void sort(byte[] array)
array
- the byte array to sortpublic static void sort(byte[] array, int start, int end)
array
- the byte array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void sort(char[] array)
array
- the char array to sortpublic static void sort(char[] array, int start, int end)
array
- the char array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void sort(double[] array)
array
- the double array to sortsort(double[], int, int)
public static void sort(double[] array, int start, int end)
array
- the double array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
Double#compareTo(Double)
public static void sort(float[] array)
array
- the float array to sortsort(float[], int, int)
public static void sort(float[] array, int start, int end)
array
- the float array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
Float#compareTo(Float)
public static void sort(int[] array)
array
- the int array to sortpublic static void sort(int[] array, int start, int end)
array
- the int array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void sort(long[] array)
array
- the long array to sortpublic static void sort(long[] array, int start, int end)
array
- the long array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
public static void sort(java.lang.Object[] array)
array
- the Object array to sort
java.lang.ClassCastException
- when an element in the array does not implement Comparable or elements cannot be compared to each
otherpublic static void sort(java.lang.Object[] array, int start, int end)
array
- the Object array to sortstart
- the start indexend
- the end index + 1
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()
public static void sort(java.lang.Object[] array, int start, int end, Comparator comparator)
array
- the Object array to sortstart
- the start indexend
- the end index + 1comparator
- the Comparator
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()
public static void sort(java.lang.Object[] array, Comparator comparator)
array
- the Object array to sortcomparator
- the Comparator
java.lang.ClassCastException
- when elements in the array cannot be compared to each other using the Comparatorpublic static void sort(short[] array)
array
- the short array to sortpublic static void sort(short[] array, int start, int end)
array
- the short array to sortstart
- the start indexend
- the end index + 1
java.lang.IllegalArgumentException
- when start > end
java.lang.ArrayIndexOutOfBoundsException
- when start < 0
or end > array.size()
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.
array
- The boolean
array to convert.
String
representation of array
.public static java.lang.String toString(byte[] array)
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.
array
- The byte
array to convert.
String
representation of array
.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.
array
- The char
array to convert.
String
representation of array
.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.
array
- The double
array to convert.
String
representation of array
.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.
array
- The float
array to convert.
String
representation of array
.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.
array
- The int
array to convert.
String
representation of array
.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.
array
- The long
array to convert.
String
representation of array
.public static java.lang.String toString(short[] array)
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.
array
- The short
array to convert.
String
representation of array
.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.
array
- The Object
array to convert.
String
representation of array
.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.
array
- The Object
array to convert.
String
representation of array
.public static java.lang.Object[] clone(java.lang.Object[] array)
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 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |