Java Utililty Methods Array Max Value

List of utility methods to do Array Max Value

Description

The list of methods to do Array Max Value are organized into topic(s).

Method

byte[]max(byte[] lArray, byte[] rArray)
max
int cmp = compare(lArray, 0, lArray.length, rArray, 0, rArray.length);
if (cmp >= 0) {
    return lArray;
} else {
    return rArray;
bytemax(byte[] values)
Get the maximum value in an array subset
return max(values, 0, values.length);
Dmax(D... comparables)
Returns the maximum value.
D max = null;
for (int i = 0; i < comparables.length; i++) {
    D element = comparables[i];
    if (element != null) {
        if (max == null || max.compareTo(element) < 0) {
            max = element;
return max;
doublemax(double array[], int start, int length)
max
double max = array[start];
final int end = start + length;
for (int i = start + 1; i < end; i++) {
    double v = array[i];
    if (v > max) {
        max = v;
return max;
doublemax(double values[])
Finds maximum value in the given vector.
double max = Double.NEGATIVE_INFINITY;
for (double value : values) {
    if (value > max)
        max = value;
return max;
doublemax(double values[], int size)
max
if (values == null || size == 0) {
    return Double.NaN;
double r = Double.NEGATIVE_INFINITY;
for (int i = 0; i < size; i++) {
    double v = values[i];
    if (!Double.isNaN(v) && r < v) {
        r = v;
...
doublemax(double... a)
Computes the maximum value of a vararg of doubles.
if (a == null) {
    return 0;
if (a.length == 0) {
    return 0;
double max = Double.MIN_VALUE;
for (double d : a) {
...
doublemax(double... arr)
max
double max = Double.MIN_VALUE;
for (double d : arr)
    if (d > max)
        max = d;
return max;
doublemax(double... ds)
max
if (ds.length < 2) {
    throw new IllegalArgumentException("Input values cannot be fewer than 2");
double max_value = ds[0];
for (int i = 1; i < ds.length; i++) {
    if (ds[i] > max_value) {
        max_value = ds[i];
return max_value;
doublemax(double... ds)
max
double maxv = ds[0];
for (int i = 1; i < ds.length; i++) {
    maxv = Math.max(ds[i], maxv);
return maxv;