|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Arrays
public class Arrays
This class contains various static utility methods performing operations on
arrays, and a method to provide a List "view" of an array to facilitate
using arrays with Collection-based APIs. All methods throw a
NullPointerException
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
,
Comparator
Method Summary | |
---|---|
static void |
fill(Object[] a,
int fromIndex,
int toIndex,
Object val)
Fill a range of an array with an Object value. |
static void |
fill(Object[] a,
Object val)
Fill an array with an Object value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void fill(Object[] a, Object val)
a
- the array to fillval
- the value to fill it with
ClassCastException
- if val is not an instance of the element
type of a.public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
a
- the array to fillfromIndex
- the index to fill from, inclusivetoIndex
- the index to fill to, exclusiveval
- the value to fill with
ClassCastException
- if val is not an instance of the element
type of a.
IllegalArgumentException
- if fromIndex > toIndex
ArrayIndexOutOfBoundsException
- if fromIndex < 0
|| toIndex > a.length
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |