All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.util.collections.Arrays

java.lang.Object
   |
   +----com.sun.java.util.collections.Arrays

public class Arrays
extends Object
This class contains various methods for manipulating arrays (such as sorting and searching). It also contains a static factory that allows arrays to be viewed as Lists.

See Also:
Comparable, Comparator

Method Index

 o asList(Object[])
Returns a fixed-size List backed by the specified array.
 o binarySearch(byte[], byte)
Searches the specified array of bytes for the specified value using the binary search algorithm.
 o binarySearch(char[], char)
Searches the specified array of chars for the specified value using the binary search algorithm.
 o binarySearch(double[], double)
Searches the specified array of doubles for the specified value using the binary search algorithm.
 o binarySearch(float[], float)
Searches the specified array of floats for the specified value using the binary search algorithm.
 o binarySearch(int[], int)
Searches the specified array of ints for the specified value using the binary search algorithm.
 o binarySearch(long[], long)
Searches the specified array of longs for the specified value using the binary search algorithm.
 o binarySearch(Object[], Object)
Searches the specified array for the specified Object using the binary search algorithm.
 o binarySearch(Object[], Object, Comparator)
Searches the specified array for the specified Object using the binary search algorithm.
 o binarySearch(short[], short)
Searches the specified array of shorts for the specified value using the binary search algorithm.
 o equals(boolean[], boolean[])
Returns true if the the two specified arrays of booleans are equal to one another.
 o equals(byte[], byte[])
Returns true if the the two specified arrays of bytes are equal to one another.
 o equals(char[], char[])
Returns true if the the two specified arrays of chars are equal to one another.
 o equals(double[], double[])
Returns true if the the two specified arrays of doubles are equal to one another.
 o equals(float[], float[])
Returns true if the the two specified arrays of floats are equal to one another.
 o equals(int[], int[])
Returns true if the the two specified arrays of ints are equal to one another.
 o equals(long[], long[])
Returns true if the the two specified arrays of longs are equal to one another.
 o equals(Object[], Object[])
Returns true if the the two specified arrays of Objects are equal to one another.
 o equals(short[], short[])
Returns true if the the two specified arrays of shorts are equal to one another.
 o fill(boolean[], boolean)
Assigns the specified boolean value to each element of the specified array of booleans.
 o fill(boolean[], int, int, boolean)
Assigns the specified boolean value to each element of the specified range of the specified array of booleans.
 o fill(byte[], byte)
Assigns the specified byte value to each element of the specified array of bytes.
 o fill(byte[], int, int, byte)
Assigns the specified byte value to each element of the specified range of the specified array of bytes.
 o fill(char[], char)
Assigns the specified char value to each element of the specified array of chars.
 o fill(char[], int, int, char)
Assigns the specified char value to each element of the specified range of the specified array of chars.
 o fill(double[], double)
Assigns the specified double value to each element of the specified array of doubles.
 o fill(double[], int, int, double)
Assigns the specified double value to each element of the specified range of the specified array of doubles.
 o fill(float[], float)
Assigns the specified float value to each element of the specified array of floats.
 o fill(float[], int, int, float)
Assigns the specified float value to each element of the specified range of the specified array of floats.
 o fill(int[], int)
Assigns the specified int value to each element of the specified array of ints.
 o fill(int[], int, int, int)
Assigns the specified int value to each element of the specified range of the specified array of ints.
 o fill(long[], int, int, long)
Assigns the specified long value to each element of the specified range of the specified array of longs.
 o fill(long[], long)
Assigns the specified long value to each element of the specified array of longs.
 o fill(Object[], int, int, Object)
Assigns the specified Object reference to each element of the specified range of the specified array of Objects.
 o fill(Object[], Object)
Assigns the specified Object reference to each element of the specified array of Objects.
 o fill(short[], int, int, short)
Assigns the specified short value to each element of the specified range of the specified array of shorts.
 o fill(short[], short)
Assigns the specified short value to each element of the specified array of shorts.
 o sort(byte[])
Sorts the specified array of bytes into ascending numerical order.
 o sort(char[])
Sorts the specified array of chars into ascending numerical order.
 o sort(double[])
Sorts the specified array of doubles into ascending numerical order.
 o sort(float[])
Sorts the specified array of floats into ascending numerical order.
 o sort(int[])
Sorts the specified array of ints into ascending numerical order.
 o sort(long[])
Sorts the specified array of longs into ascending numerical order.
 o sort(Object[])
Sorts the specified array of objects into ascending order, according to the natural ordering of its elements.
 o sort(Object[], Comparator)
Sorts the specified array of objects according to the order induced by the specified Comparator.
 o sort(short[])
Sorts the specified array of shorts into ascending numerical order.

Methods

 o sort
 public static void sort(long a[])
Sorts the specified array of longs into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(int a[])
Sorts the specified array of ints into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(short a[])
Sorts the specified array of shorts into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(char a[])
Sorts the specified array of chars into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(byte a[])
Sorts the specified array of bytes into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(double a[])
Sorts the specified array of doubles into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(float a[])
Sorts the specified array of floats into ascending numerical order. The sorting algorithm 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.

Parameters:
a - the array to be sorted.
 o sort
 public static void sort(Object a[])
Sorts the specified array of objects into ascending order, according to the natural ordering of its elements. All elements in the array must implement the Comparable interface. Furthermore, all elements in the array must be mutually comparable (that is, e1.compareTo(e2) must not throw a typeMismatchException for any elements e1 and e2 in the array).

This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist). This algorithm offers guaranteed n*log(n) performance, and can approach linear performance on nearly sorted lists.

Parameters:
a - the array to be sorted.
Throws: ClassCastException
array contains elements that are not mutually comparable (for example, Strings and Integers).
See Also:
Comparable
 o sort
 public static void sort(Object a[],
                         Comparator c)
Sorts the specified array of objects according to the order induced by the specified Comparator. All elements in the array must be mutually comparable by the specified comparator (that is, comparator.compare(e1, e2) must not throw a typeMismatchException for any elements e1 and e2 in the array).

This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.

The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist). This algorithm offers guaranteed n*log(n) performance, and can approach linear performance on nearly sorted lists.

Parameters:
a - the array to be sorted.
c - the Comparator to determine the order of the array.
Throws: ClassCastException
array contains elements that are not mutually comparable with the specified Comparator.
See Also:
Comparator
 o binarySearch
 public static int binarySearch(long a[],
                                long key)
Searches the specified array of longs for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(insertion point) - 1). The insertion point is defined as the the point at which the value would be inserted into the array: the index of the first element greater than the value, or a.length, if all elements in the array are less than the specified value. Note that this guarantees that the return value will be >= 0 if and only if the object is found.
See Also:
sort
 o binarySearch
 public static int binarySearch(int a[],
                                int key)
Searches the specified array of ints for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(short a[],
                                short key)
Searches the specified array of shorts for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(char a[],
                                char key)
Searches the specified array of chars for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(byte a[],
                                byte key)
Searches the specified array of bytes for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(double a[],
                                double key)
Searches the specified array of doubles for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(float a[],
                                float key)
Searches the specified array of floats for the specified value using the binary search algorithm. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
See Also:
sort
 o binarySearch
 public static int binarySearch(Object a[],
                                Object key)
Searches the specified array for the specified Object using the binary search algorithm. The array must be sorted into ascending order according to the natural ordering of its elements (as by Sort(Object[]), above) prior to making this call. The array must must be sorted (as by the sort method, above) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
Throws: ClassCastException
array contains elements that are not mutually comparable (for example, Strings and Integers), or the search key in not mutually comparable with the elements of the array.
See Also:
Comparable, sort
 o binarySearch
 public static int binarySearch(Object a[],
                                Object key,
                                Comparator c)
Searches the specified array for the specified Object using the binary search algorithm. The array must be sorted into ascending order according to the specified Comparator (as by Sort(Object[], Comparator), above), prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the array contains multiple elements equal to the specified object, there is no guarantee which instance will be found.

Parameters:
a - the array to be searched.
key - the value to be searched for.
c - the Comparator to determine the order of the array.
Returns:
index of the search key, if it is contained in the array; otherwise, (-(the "insertion point") - 1).
Throws: ClassCastException
array contains elements that are not mutually comparable with the specified Comparator, or the search key in not mutually comparable with the elements of the array using this Comparator.
See Also:
Comparable, sort
 o equals
 public static boolean equals(long a[],
                              long a2[])
Returns true if the the two specified arrays of longs are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(int a[],
                              int a2[])
Returns true if the the two specified arrays of ints are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(short a[],
                              short a2[])
Returns true if the the two specified arrays of shorts are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(char a[],
                              char a2[])
Returns true if the the two specified arrays of chars are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(byte a[],
                              byte a2[])
Returns true if the the two specified arrays of bytes are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(boolean a[],
                              boolean a2[])
Returns true if the the two specified arrays of booleans are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(double a[],
                              double a2[])
Returns true if the the two specified arrays of doubles are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(float a[],
                              float a2[])
Returns true if the the two specified arrays of floats are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o equals
 public static boolean equals(Object a[],
                              Object a2[])
Returns true if the the two specified arrays of Objects are equal to one another. The two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. (Two objects e1 and e2 are considered equal if (e1==null ? e2==null : e1.equals(e2)).) In other words, the two arrays are equal if they contain the same elements in the same order. Also, the arrays are considered equal if both are null.

Parameters:
a - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.
 o fill
 public static void fill(long a[],
                         long val)
Assigns the specified long value to each element of the specified array of longs.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(long a[],
                         int fromIndex,
                         int toIndex,
                         long val)
Assigns the specified long value to each element of the specified range of the specified array of longs.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(int a[],
                         int val)
Assigns the specified int value to each element of the specified array of ints.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(int a[],
                         int fromIndex,
                         int toIndex,
                         int val)
Assigns the specified int value to each element of the specified range of the specified array of ints.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(short a[],
                         short val)
Assigns the specified short value to each element of the specified array of shorts.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(short a[],
                         int fromIndex,
                         int toIndex,
                         short val)
Assigns the specified short value to each element of the specified range of the specified array of shorts.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(char a[],
                         char val)
Assigns the specified char value to each element of the specified array of chars.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(char a[],
                         int fromIndex,
                         int toIndex,
                         char val)
Assigns the specified char value to each element of the specified range of the specified array of chars.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(byte a[],
                         byte val)
Assigns the specified byte value to each element of the specified array of bytes.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(byte a[],
                         int fromIndex,
                         int toIndex,
                         byte val)
Assigns the specified byte value to each element of the specified range of the specified array of bytes.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(boolean a[],
                         boolean val)
Assigns the specified boolean value to each element of the specified array of booleans.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(boolean a[],
                         int fromIndex,
                         int toIndex,
                         boolean val)
Assigns the specified boolean value to each element of the specified range of the specified array of booleans.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(double a[],
                         double val)
Assigns the specified double value to each element of the specified array of doubles.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(double a[],
                         int fromIndex,
                         int toIndex,
                         double val)
Assigns the specified double value to each element of the specified range of the specified array of doubles.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(float a[],
                         float val)
Assigns the specified float value to each element of the specified array of floats.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(float a[],
                         int fromIndex,
                         int toIndex,
                         float val)
Assigns the specified float value to each element of the specified range of the specified array of floats.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(Object a[],
                         Object val)
Assigns the specified Object reference to each element of the specified array of Objects.

Parameters:
a - the array to be filled.
val - the value to be stored in all elements of the array.
 o fill
 public static void fill(Object a[],
                         int fromIndex,
                         int toIndex,
                         Object val)
Assigns the specified Object reference to each element of the specified range of the specified array of Objects.

Parameters:
a - the array to be filled.
fromIndex - the index of the first element (inclusive) to be filled with the specified value.
toIndex - the index of the last element (exclusive) to be filled with the specified value.
val - the value to be stored in all elements of the array.
 o asList
 public static List asList(Object a[])
Returns a fixed-size List backed by the specified array. (Changes to the returned List "write through" to the array.) This method acts as bridge between array-based and Collection-based APIs, in combination with Collection.toArray. The returned List is Serializable.

Parameters:
a - the array by which the List will be backed.
Returns:
a List view of the specified array.
See Also:
toArray

All Packages  Class Hierarchy  This Package  Previous  Next  Index