public static double max(final double[] data, final int startInclusive, final int endExclusive) {
    checkArgument(endExclusive > startInclusive);
    checkArgument(startInclusive >= 0);
    checkArgument(endExclusive <= data.length);

    double maxValue = Double.NEGATIVE_INFINITY;
    for (int i = startInclusive; i < endExclusive; ++i) {
      maxValue = Math.max(maxValue, data[i]);
    }
    return maxValue;
  }
public static double max ( final double [ ] data , final int startInclusive , final int endExclusive ) { checkArgument ( endExclusive > startInclusive ) ; checkArgument ( startInclusive >= 0 ) ; checkArgument ( endExclusive <= data . length ) ; double maxValue = Double . NEGATIVE_INFINITY ; for ( int i = startInclusive ; i < endExclusive ; ++ i ) { maxValue = Math . max ( maxValue , data [ i ] ) ; } return maxValue ; }
Returns the maximum value in the array within the specified bounds. If the supplied range is
empty or invalid, an {@link IllegalArgumentException} is thrown.