| GNU Classpath (0.95) | |
| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectjava.util.ArraysNullPointerException if the parameter array is null.
Implementations may use their own algorithms, but must obey the general
properties; for example, the sort must be stable and n*log(n) complexity.
Sun's implementation of sort, and therefore ours, is a tuned quicksort,
adapted from Jon L. Bentley and M. Douglas McIlroy's "Engineering a Sort
Function", Software-Practice and Experience, Vol. 23(11) P. 1249-1265
(November 1993). This algorithm offers n*log(n) performance on many data
sets that cause other quicksorts to degrade to quadratic performance.
Comparable, ComparatorMethod Summary | |
static |
|
static |
|
static |
|
static |
|
static |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static boolean[] |
|
static byte[] |
|
static char[] |
|
static double[] |
|
static float[] |
|
static int[] |
|
static long[] |
|
static short[] |
|
static boolean[] |
|
static byte[] |
|
static char[] |
|
static double[] |
|
static float[] |
|
static int[] |
|
static long[] |
|
static short[] |
|
static boolean |
|
static int |
|
static String |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean |
|
static boolean | |
static boolean |
|
static boolean |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void | |
static void | |
static void |
|
static void |
|
static void |
|
static void |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int | |
static int |
|
static int |
|
static |
|
static |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void |
|
static void | |
static void | |
static void |
|
static void |
|
static void |
|
static void |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String |
|
static String | |
static String |
|
static String |
|
static |
|
static |
|
Methods inherited from class java.lang.Object | |
clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait | |
public staticList asList (T... a)
Returns a list "view" of the specified array. This method is intended to make it easy to use the Collections API with existing array-based APIs and programs. Changes in the list or the array show up in both places. The list does not support element addition or removal, but does permit value modification. The returned list implements both Serializable and RandomAccess.
- Parameters:
a- the array to return a view of (nullnot permitted)
- Returns:
- a fixed-size list, changes to which "write through" to the array
- Throws:
NullPointerException- ifaisnull.
- See Also:
Serializable,RandomAccess,Arrays.ArrayList
public staticT[] copyOf(T[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary withnullto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will returnnull. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
nullto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(T[],int,int)
public staticT[] copyOf(U[] original, int newLength, >[] newType)
Returns a copy of the supplied array, truncating or padding as necessary withnullto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will returnnull. This is equivalent to callingcopyOfRange(original, 0, newLength, newType). The returned array will be of the specified type,newType.
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.newType- the type of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
nullto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(U[],int,int,Class)
public staticT[] copyOfRange(T[] original, int from, int to)
Copies the specified range of the supplied array to a new array, padding as necessary withnulliftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded withnullwill be returned). The returned array is always of lengthto - from.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOf(T[],int)
public staticT[] copyOfRange(U[] original, int from, int to, >[] newType)
Copies the specified range of the supplied array to a new array, padding as necessary withnulliftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded withnullwill be returned). The returned array is always of lengthto - fromand will be of the specified type,newType.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.newType- the type of the returned array.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOf(T[],int)
public static int binarySearch(byte[] a, byte key)
Perform a binary search of a byte array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(byte[] a, int low, int hi, byte key)
Perform a binary search of a range of a byte array for a key. The range must be sorted (as by thesort(byte[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(char[] a, char key)
Perform a binary search of a char array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(char[] a, int low, int hi, char key)
Perform a binary search of a range of a char array for a key. The range must be sorted (as by thesort(char[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(double[] a, double key)
Perform a binary search of a double array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(double[] a, int low, int hi, double key)
Perform a binary search of a range of a double array for a key. The range must be sorted (as by thesort(double[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(float[] a, float key)
Perform a binary search of a float array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(float[] a, int low, int hi, float key)
Perform a binary search of a range of a float array for a key. The range must be sorted (as by thesort(float[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(int[] a, int key)
Perform a binary search of an int array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(int[] a, int low, int hi, int key)
Perform a binary search of a range of an integer array for a key. The range must be sorted (as by thesort(int[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(Object[] a, int low, int hi, Object key)
Perform a binary search of a range of an Object array for a key. The range must be sorted (as by thesort(Object[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(Object[] a, Object key)
Perform a binary search of an Object array for a key, using the natural ordering of the elements. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. Further, the key must be comparable with every item in the array. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this (JCL) implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
ClassCastException- if key could not be compared with one of the elements of aNullPointerException- if a null element in a is compared
public static int binarySearch(long[] a, int low, int hi, long key)
Perform a binary search of a range of a long array for a key. The range must be sorted (as by thesort(long[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(long[] a, long key)
Perform a binary search of a long array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static int binarySearch(short[] a, int low, int hi, short key)
Perform a binary search of a range of a short array for a key. The range must be sorted (as by thesort(short[], int, int)method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)low- the lowest index to search from.hi- the highest index to search to.key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
- Throws:
IllegalArgumentException- iflow > hiArrayIndexOutOfBoundsException- iflow <320orhi > a.length.
public static int binarySearch(short[] a, short key)
Perform a binary search of a short array for a key. The array must be sorted (as by the sort() method) - if it is not, the behaviour of this method is undefined, and may be an infinite loop. If the array contains the key more than once, any one of them may be found. Note: although the specification allows for an infinite loop if the array is unsorted, it will not happen in this implementation.
- Parameters:
a- the array to search (must be sorted)key- the value to search for
- Returns:
- the index at which the key was found, or -n-1 if it was not found, where n is the index of the first value higher than key or a.length if there is no such value.
public static boolean[] copyOf(boolean[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary withfalseto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will returnfalse. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
falseto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(boolean[],int,int)
public static byte[] copyOf(byte[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with(byte)0to obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return(byte)0. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
(byte)0to obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(byte[],int,int)
public static char[] copyOf(char[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with'\0'to obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return'\0'. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
'\0'to obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(char[],int,int)
public static double[] copyOf(double[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with0dto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return0d. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
0dto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(double[],int,int)
public static float[] copyOf(float[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with0fto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return0f. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
0fto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(float[],int,int)
public static int[] copyOf(int[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with0to obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return0. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
0to obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(int[],int,int)
public static long[] copyOf(long[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with0Lto obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return0L. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
0Lto obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(long[],int,int)
public static short[] copyOf(short[] original, int newLength)
Returns a copy of the supplied array, truncating or padding as necessary with(short)0to obtain the specified length. Indices that are valid for both arrays will return the same value. Indices that only exist in the returned array (due to the new length being greater than the original length) will return(short)0. This is equivalent to callingcopyOfRange(original, 0, newLength).
- Parameters:
original- the original array to be copied.newLength- the length of the returned array.
- Returns:
- a copy of the original array, truncated or padded with
(short)0to obtain the required length.
- Throws:
NegativeArraySizeException- ifnewLengthis negative.NullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOfRange(short[],int,int)
public static boolean[] copyOfRange(boolean[] original, int from, int to)
Copies the specified range of the supplied array to a new array, padding as necessary withfalseiftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded withfalsewill be returned). The returned array is always of lengthto - from.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOf(boolean[],int)
public static byte[] copyOfRange(byte[] original, int from, int to)
Copies the specified range of the supplied array to a new array, padding as necessary with(byte)0iftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded with(byte)0will be returned). The returned array is always of lengthto - from.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOf(byte[],int)
public static char[] copyOfRange(char[] original, int from, int to)
Copies the specified range of the supplied array to a new array, padding as necessary with'\0'iftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded with'\0'will be returned). The returned array is always of lengthto - from.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6
- See Also:
copyOf(char[],int)
public static double[] copyOfRange(double[] original, int from, int to)
Copies the specified range of the supplied array to a new array, padding as necessary with0diftois greater than the length of the original array.frommust be in the range zero tooriginal.lengthand can not be greater thanto. The initial element of the returned array will be equal tooriginal[from], except wherefromis equal toto(where a zero-length array will be returned) orfromis equal tooriginal.length(where an array padded with0dwill be returned). The returned array is always of lengthto - from.
- Parameters:
original- the array from which to copy.from- the initial index of the range, inclusive.to- the final index of the range, exclusive.
- Returns:
- a copy of the specified range, with padding to obtain the required length.
- Throws:
ArrayIndexOutOfBoundsException- iffrom <320orfrom > original.lengthIllegalArgumentException- iffrom > toNullPointerException- iforiginalisnull.
- Since:
- 1.6