Lines Matching refs:toIndex

111      * Checks that {@code fromIndex} and {@code toIndex} are in
114 private static void rangeCheck(int arrayLength, int fromIndex, int toIndex) {
115 if (fromIndex > toIndex) {
117 "fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
122 if (toIndex > arrayLength) {
123 throw new ArrayIndexOutOfBoundsException(toIndex);
167 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
178 * @param toIndex the index of the last element, exclusive, to be sorted
180 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
182 * if {@code fromIndex < 0} or {@code toIndex > a.length}
184 public static void sort(int[] a, int fromIndex, int toIndex) {
185 rangeCheck(a.length, fromIndex, toIndex);
186 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
207 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
218 * @param toIndex the index of the last element, exclusive, to be sorted
220 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
222 * if {@code fromIndex < 0} or {@code toIndex > a.length}
224 public static void sort(long[] a, int fromIndex, int toIndex) {
225 rangeCheck(a.length, fromIndex, toIndex);
226 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
247 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
258 * @param toIndex the index of the last element, exclusive, to be sorted
260 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
262 * if {@code fromIndex < 0} or {@code toIndex > a.length}
264 public static void sort(short[] a, int fromIndex, int toIndex) {
265 rangeCheck(a.length, fromIndex, toIndex);
266 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
287 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
298 * @param toIndex the index of the last element, exclusive, to be sorted
300 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
302 * if {@code fromIndex < 0} or {@code toIndex > a.length}
304 public static void sort(char[] a, int fromIndex, int toIndex) {
305 rangeCheck(a.length, fromIndex, toIndex);
306 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
327 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
338 * @param toIndex the index of the last element, exclusive, to be sorted
340 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
342 * if {@code fromIndex < 0} or {@code toIndex > a.length}
344 public static void sort(byte[] a, int fromIndex, int toIndex) {
345 rangeCheck(a.length, fromIndex, toIndex);
346 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1);
375 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
394 * @param toIndex the index of the last element, exclusive, to be sorted
396 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
398 * if {@code fromIndex < 0} or {@code toIndex > a.length}
400 public static void sort(float[] a, int fromIndex, int toIndex) {
401 rangeCheck(a.length, fromIndex, toIndex);
402 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
431 * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
450 * @param toIndex the index of the last element, exclusive, to be sorted
452 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
454 * if {@code fromIndex < 0} or {@code toIndex > a.length}
456 public static void sort(double[] a, int fromIndex, int toIndex) {
457 rangeCheck(a.length, fromIndex, toIndex);
458 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
494 * inclusive, to the index {@code toIndex}, exclusive. If
495 * {@code fromIndex == toIndex}, the range to be sorted is empty.
510 * @param toIndex the index of the last element, exclusive, to be sorted
512 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
514 * if {@code fromIndex < 0} or {@code toIndex > a.length}
518 public static void parallelSort(byte[] a, int fromIndex, int toIndex) {
519 rangeCheck(a.length, fromIndex, toIndex);
520 int n = toIndex - fromIndex, p, g;
523 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1);
564 * inclusive, to the index {@code toIndex}, exclusive. If
565 * {@code fromIndex == toIndex}, the range to be sorted is empty.
580 * @param toIndex the index of the last element, exclusive, to be sorted
582 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
584 * if {@code fromIndex < 0} or {@code toIndex > a.length}
588 public static void parallelSort(char[] a, int fromIndex, int toIndex) {
589 rangeCheck(a.length, fromIndex, toIndex);
590 int n = toIndex - fromIndex, p, g;
593 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
634 * inclusive, to the index {@code toIndex}, exclusive. If
635 * {@code fromIndex == toIndex}, the range to be sorted is empty.
650 * @param toIndex the index of the last element, exclusive, to be sorted
652 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
654 * if {@code fromIndex < 0} or {@code toIndex > a.length}
658 public static void parallelSort(short[] a, int fromIndex, int toIndex) {
659 rangeCheck(a.length, fromIndex, toIndex);
660 int n = toIndex - fromIndex, p, g;
663 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
704 * inclusive, to the index {@code toIndex}, exclusive. If
705 * {@code fromIndex == toIndex}, the range to be sorted is empty.
720 * @param toIndex the index of the last element, exclusive, to be sorted
722 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
724 * if {@code fromIndex < 0} or {@code toIndex > a.length}
728 public static void parallelSort(int[] a, int fromIndex, int toIndex) {
729 rangeCheck(a.length, fromIndex, toIndex);
730 int n = toIndex - fromIndex, p, g;
733 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
774 * inclusive, to the index {@code toIndex}, exclusive. If
775 * {@code fromIndex == toIndex}, the range to be sorted is empty.
790 * @param toIndex the index of the last element, exclusive, to be sorted
792 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
794 * if {@code fromIndex < 0} or {@code toIndex > a.length}
798 public static void parallelSort(long[] a, int fromIndex, int toIndex) {
799 rangeCheck(a.length, fromIndex, toIndex);
800 int n = toIndex - fromIndex, p, g;
803 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
852 * inclusive, to the index {@code toIndex}, exclusive. If
853 * {@code fromIndex == toIndex}, the range to be sorted is empty.
876 * @param toIndex the index of the last element, exclusive, to be sorted
878 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
880 * if {@code fromIndex < 0} or {@code toIndex > a.length}
884 public static void parallelSort(float[] a, int fromIndex, int toIndex) {
885 rangeCheck(a.length, fromIndex, toIndex);
886 int n = toIndex - fromIndex, p, g;
889 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
938 * inclusive, to the index {@code toIndex}, exclusive. If
939 * {@code fromIndex == toIndex}, the range to be sorted is empty.
962 * @param toIndex the index of the last element, exclusive, to be sorted
964 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
966 * if {@code fromIndex < 0} or {@code toIndex > a.length}
970 public static void parallelSort(double[] a, int fromIndex, int toIndex) {
971 rangeCheck(a.length, fromIndex, toIndex);
972 int n = toIndex - fromIndex, p, g;
975 DualPivotQuicksort.sort(a, fromIndex, toIndex - 1, null, 0, 0);
1036 * {@code fromIndex}, inclusive, to index {@code toIndex}, exclusive.
1037 * (If {@code fromIndex==toIndex}, the range to be sorted is empty.) All
1062 * @param toIndex the index of the last element (exclusive) to be sorted
1063 * @throws IllegalArgumentException if {@code fromIndex > toIndex} or
1067 * {@code toIndex > a.length}
1076 void parallelSort(T[] a, int fromIndex, int toIndex) {
1077 rangeCheck(a.length, fromIndex, toIndex);
1078 int n = toIndex - fromIndex, p, g;
1081 TimSort.sort(a, fromIndex, toIndex, NaturalOrder.INSTANCE, null, 0, 0);
1143 * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
1167 * @param toIndex the index of the last element (exclusive) to be sorted
1171 * @throws IllegalArgumentException if {@code fromIndex > toIndex} or
1175 * {@code toIndex > a.length}
1183 public static <T> void parallelSort(T[] a, int fromIndex, int toIndex,
1185 rangeCheck(a.length, fromIndex, toIndex);
1188 int n = toIndex - fromIndex, p, g;
1191 TimSort.sort(a, fromIndex, toIndex, cmp, null, 0, 0);
1259 * {@code fromIndex}, inclusive, to index {@code toIndex}, exclusive.
1260 * (If {@code fromIndex==toIndex}, the range to be sorted is empty.) All
1296 * @param toIndex the index of the last element (exclusive) to be sorted
1297 * @throws IllegalArgumentException if {@code fromIndex > toIndex} or
1301 * {@code toIndex > a.length}
1306 public static void sort(Object[] a, int fromIndex, int toIndex) {
1307 rangeCheck(a.length, fromIndex, toIndex);
1310 // legacyMergeSort(a, fromIndex, toIndex);
1312 ComparableTimSort.sort(a, fromIndex, toIndex, null, 0, 0);
1440 * {@code toIndex}, exclusive. (If {@code fromIndex==toIndex}, the
1476 * @param toIndex the index of the last element (exclusive) to be sorted
1482 * @throws IllegalArgumentException if {@code fromIndex > toIndex} or
1486 * {@code toIndex > a.length}
1488 public static <T> void sort(T[] a, int fromIndex, int toIndex,
1491 sort(a, fromIndex, toIndex);
1493 rangeCheck(a.length, fromIndex, toIndex);
1496 // legacyMergeSort(a, fromIndex, toIndex, c);
1498 TimSort.sort(a, fromIndex, toIndex, c, null, 0, 0);
1533 * @param toIndex the index of the last element, exclusive
1536 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
1538 * if {@code fromIndex < 0} or {@code toIndex > array.length}
1543 int toIndex, BinaryOperator<T> op) {
1545 rangeCheck(array.length, fromIndex, toIndex);
1546 if (fromIndex < toIndex)
1548 (null, op, array, fromIndex, toIndex).invoke();
1578 * @param toIndex the index of the last element, exclusive
1581 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
1583 * if {@code fromIndex < 0} or {@code toIndex > array.length}
1588 int toIndex, LongBinaryOperator op) {
1590 rangeCheck(array.length, fromIndex, toIndex);
1591 if (fromIndex < toIndex)
1593 (null, op, array, fromIndex, toIndex).invoke();
1626 * @param toIndex the index of the last element, exclusive
1629 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
1631 * if {@code fromIndex < 0} or {@code toIndex > array.length}
1636 int toIndex, DoubleBinaryOperator op) {
1638 rangeCheck(array.length, fromIndex, toIndex);
1639 if (fromIndex < toIndex)
1641 (null, op, array, fromIndex, toIndex).invoke();
1671 * @param toIndex the index of the last element, exclusive
1674 * @throws IllegalArgumentException if {@code fromIndex > toIndex}
1676 * if {@code fromIndex < 0} or {@code toIndex > array.length}
1681 int toIndex, IntBinaryOperator op) {
1683 rangeCheck(array.length, fromIndex, toIndex);
1684 if (fromIndex < toIndex)
1686 (null, op, array, fromIndex, toIndex).invoke();
1728 * @param toIndex the index of the last element (exclusive) to be searched
1736 * or <tt>toIndex</tt> if all
1741 * if {@code fromIndex > toIndex}
1743 * if {@code fromIndex < 0 or toIndex > a.length}
1746 public static int binarySearch(long[] a, int fromIndex, int toIndex,
1748 rangeCheck(a.length, fromIndex, toIndex);
1749 return binarySearch0(a, fromIndex, toIndex, key);
1753 private static int binarySearch0(long[] a, int fromIndex, int toIndex,
1756 int high = toIndex - 1;
1809 * @param toIndex the index of the last element (exclusive) to be searched
1817 * or <tt>toIndex</tt> if all
1822 * if {@code fromIndex > toIndex}
1824 * if {@code fromIndex < 0 or toIndex > a.length}
1827 public static int binarySearch(int[] a, int fromIndex, int toIndex,
1829 rangeCheck(a.length, fromIndex, toIndex);
1830 return binarySearch0(a, fromIndex, toIndex, key);
1834 private static int binarySearch0(int[] a, int fromIndex, int toIndex,
1837 int high = toIndex - 1;
1890 * @param toIndex the index of the last element (exclusive) to be searched
1898 * or <tt>toIndex</tt> if all
1903 * if {@code fromIndex > toIndex}
1905 * if {@code fromIndex < 0 or toIndex > a.length}
1908 public static int binarySearch(short[] a, int fromIndex, int toIndex,
1910 rangeCheck(a.length, fromIndex, toIndex);
1911 return binarySearch0(a, fromIndex, toIndex, key);
1915 private static int binarySearch0(short[] a, int fromIndex, int toIndex,
1918 int high = toIndex - 1;
1971 * @param toIndex the index of the last element (exclusive) to be searched
1979 * or <tt>toIndex</tt> if all
1984 * if {@code fromIndex > toIndex}
1986 * if {@code fromIndex < 0 or toIndex > a.length}
1989 public static int binarySearch(char[] a, int fromIndex, int toIndex,
1991 rangeCheck(a.length, fromIndex, toIndex);
1992 return binarySearch0(a, fromIndex, toIndex, key);
1996 private static int binarySearch0(char[] a, int fromIndex, int toIndex,
1999 int high = toIndex - 1;
2052 * @param toIndex the index of the last element (exclusive) to be searched
2060 * or <tt>toIndex</tt> if all
2065 * if {@code fromIndex > toIndex}
2067 * if {@code fromIndex < 0 or toIndex > a.length}
2070 public static int binarySearch(byte[] a, int fromIndex, int toIndex,
2072 rangeCheck(a.length, fromIndex, toIndex);
2073 return binarySearch0(a, fromIndex, toIndex, key);
2077 private static int binarySearch0(byte[] a, int fromIndex, int toIndex,
2080 int high = toIndex - 1;
2135 * @param toIndex the index of the last element (exclusive) to be searched
2143 * or <tt>toIndex</tt> if all
2148 * if {@code fromIndex > toIndex}
2150 * if {@code fromIndex < 0 or toIndex > a.length}
2153 public static int binarySearch(double[] a, int fromIndex, int toIndex,
2155 rangeCheck(a.length, fromIndex, toIndex);
2156 return binarySearch0(a, fromIndex, toIndex, key);
2160 private static int binarySearch0(double[] a, int fromIndex, int toIndex,
2163 int high = toIndex - 1;
2226 * @param toIndex the index of the last element (exclusive) to be searched
2234 * or <tt>toIndex</tt> if all
2239 * if {@code fromIndex > toIndex}
2241 * if {@code fromIndex < 0 or toIndex > a.length}
2244 public static int binarySearch(float[] a, int fromIndex, int toIndex,
2246 rangeCheck(a.length, fromIndex, toIndex);
2247 return binarySearch0(a, fromIndex, toIndex, key);
2251 private static int binarySearch0(float[] a, int fromIndex, int toIndex,
2254 int high = toIndex - 1;
2330 * @param toIndex the index of the last element (exclusive) to be searched
2338 * or <tt>toIndex</tt> if all
2345 * if {@code fromIndex > toIndex}
2347 * if {@code fromIndex < 0 or toIndex > a.length}
2350 public static int binarySearch(Object[] a, int fromIndex, int toIndex,
2352 rangeCheck(a.length, fromIndex, toIndex);
2353 return binarySearch0(a, fromIndex, toIndex, key);
2357 private static int binarySearch0(Object[] a, int fromIndex, int toIndex,
2360 int high = toIndex - 1;
2430 * @param toIndex the index of the last element (exclusive) to be searched
2441 * or <tt>toIndex</tt> if all
2450 * if {@code fromIndex > toIndex}
2452 * if {@code fromIndex < 0 or toIndex > a.length}
2455 public static <T> int binarySearch(T[] a, int fromIndex, int toIndex,
2457 rangeCheck(a.length, fromIndex, toIndex);
2458 return binarySearch0(a, fromIndex, toIndex, key, c);
2462 private static <T> int binarySearch0(T[] a, int fromIndex, int toIndex,
2465 return binarySearch0(a, fromIndex, toIndex, key);
2468 int high = toIndex - 1;
2782 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2788 * @param toIndex the index of the last element (exclusive) to be
2791 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2793 * <tt>toIndex &gt; a.length</tt>
2795 public static void fill(long[] a, int fromIndex, int toIndex, long val) {
2796 rangeCheck(a.length, fromIndex, toIndex);
2797 for (int i = fromIndex; i < toIndex; i++)
2817 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2823 * @param toIndex the index of the last element (exclusive) to be
2826 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2828 * <tt>toIndex &gt; a.length</tt>
2830 public static void fill(int[] a, int fromIndex, int toIndex, int val) {
2831 rangeCheck(a.length, fromIndex, toIndex);
2832 for (int i = fromIndex; i < toIndex; i++)
2852 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2858 * @param toIndex the index of the last element (exclusive) to be
2861 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2863 * <tt>toIndex &gt; a.length</tt>
2865 public static void fill(short[] a, int fromIndex, int toIndex, short val) {
2866 rangeCheck(a.length, fromIndex, toIndex);
2867 for (int i = fromIndex; i < toIndex; i++)
2887 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2893 * @param toIndex the index of the last element (exclusive) to be
2896 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2898 * <tt>toIndex &gt; a.length</tt>
2900 public static void fill(char[] a, int fromIndex, int toIndex, char val) {
2901 rangeCheck(a.length, fromIndex, toIndex);
2902 for (int i = fromIndex; i < toIndex; i++)
2922 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2928 * @param toIndex the index of the last element (exclusive) to be
2931 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2933 * <tt>toIndex &gt; a.length</tt>
2935 public static void fill(byte[] a, int fromIndex, int toIndex, byte val) {
2936 rangeCheck(a.length, fromIndex, toIndex);
2937 for (int i = fromIndex; i < toIndex; i++)
2957 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2963 * @param toIndex the index of the last element (exclusive) to be
2966 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
2968 * <tt>toIndex &gt; a.length</tt>
2970 public static void fill(boolean[] a, int fromIndex, int toIndex,
2972 rangeCheck(a.length, fromIndex, toIndex);
2973 for (int i = fromIndex; i < toIndex; i++)
2993 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
2999 * @param toIndex the index of the last element (exclusive) to be
3002 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
3004 * <tt>toIndex &gt; a.length</tt>
3006 public static void fill(double[] a, int fromIndex, int toIndex,double val){
3007 rangeCheck(a.length, fromIndex, toIndex);
3008 for (int i = fromIndex; i < toIndex; i++)
3028 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
3034 * @param toIndex the index of the last element (exclusive) to be
3037 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
3039 * <tt>toIndex &gt; a.length</tt>
3041 public static void fill(float[] a, int fromIndex, int toIndex, float val) {
3042 rangeCheck(a.length, fromIndex, toIndex);
3043 for (int i = fromIndex; i < toIndex; i++)
3065 * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex==toIndex</tt>, the
3071 * @param toIndex the index of the last element (exclusive) to be
3074 * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
3076 * <tt>toIndex &gt; a.length</tt>
3080 public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
3081 rangeCheck(a.length, fromIndex, toIndex);
3082 for (int i = fromIndex; i < toIndex; i++)