public static int indexOf(double[] array, double[] sub, int startIndex, int endIndex) {
    """
	Finds the first occurrence in an array from specified given position and upto given length.
    """
		int sublen = sub.length;
		if (sublen == 0) {
			return startIndex;
		}
		int total = endIndex - sublen + 1;
		double c = sub[0];
		mainloop:
		for (int i = startIndex; i < total; i++) {
			if (Double.compare(array[i], c) != 0) {
				continue;
			}
			int j = 1;
			int k = i + 1;
			while (j < sublen) {
				if (Double.compare(sub[j], array[k]) != 0) {
					continue mainloop;
				}
				j++; k++;
			}
			return i;
		}
		return -1;
	}
public static int indexOf(double[] array, double[] sub, int startIndex, int endIndex) {
		int sublen = sub.length;
		if (sublen == 0) {
			return startIndex;
		}
		int total = endIndex - sublen + 1;
		double c = sub[0];
		mainloop:
		for (int i = startIndex; i < total; i++) {
			if (Double.compare(array[i], c) != 0) {
				continue;
			}
			int j = 1;
			int k = i + 1;
			while (j < sublen) {
				if (Double.compare(sub[j], array[k]) != 0) {
					continue mainloop;
				}
				j++; k++;
			}
			return i;
		}
		return -1;
	}
public static int indexOf ( double [ ] array , double [ ] sub , int startIndex , int endIndex ) { int sublen = sub . length ; if ( sublen == 0 ) { return startIndex ; } int total = endIndex - sublen + 1 ; double c = sub [ 0 ] ; mainloop : for ( int i = startIndex ; i < total ; i ++ ) { if ( Double . compare ( array [ i ] , c ) != 0 ) { continue ; } int j = 1 ; int k = i + 1 ; while ( j < sublen ) { if ( Double . compare ( sub [ j ] , array [ k ] ) != 0 ) { continue mainloop ; } j ++ ; k ++ ; } return i ; } return - 1 ; }
Finds the first occurrence in an array from specified given position and upto given length.
Finds the first occurrence in an array from specified given position and upto given length .