Java Utililty Methods List Max

List of utility methods to do List Max

Description

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

Method

intgetMaxStrWidth(List list)
Returns the maximum string length of the list of strings
int max = 0;
for (String s : list) {
    if (s.length() > max)
        max = s.length();
return max;
intgetMaxValIndex(List vals)
get Max Val Index
Double maxVal = Double.MIN_VALUE;
int maxValIndex = 0;
int i = 0;
for (Double val : vals) {
    if (val > maxVal) {
        maxVal = val;
        maxValIndex = i;
    i++;
return maxValIndex;
doublegetMaxValue(List list)
get Max Value
double maxValue = 0;
if (list == null)
    return 0;
for (int i = 0; i < list.size(); i++) {
    if (list.get(i) == null)
        continue;
    double d = list.get(i);
    if (maxValue < d)
...
doublegetMaxValue(List values)
get Max Value
if (values.isEmpty()) {
    return -1.0;
double max = -1.0;
for (Double value : values) {
    if (max < value) {
        max = value;
return max;
Doublemax(final List aList, final Double aDefalut)
max
Double max = aDefalut;
if (null != aList) {
    for (Double value : aList) {
        if (null != value) {
            if (null == max) {
                max = value;
            } else {
                max = Math.max(max, value);
...
doublemax(List values)
max
double max = Integer.MIN_VALUE;
for (Number value : values) {
    if (value.doubleValue() > max) {
        max = value.doubleValue();
return max;
Listmax(List a, List b)
max
if (a == null)
    return (List<T>) b;
if (b == null)
    return (List<T>) a;
List<T> result = new ArrayList<T>(a);
Map<T, Integer> coeffs = new HashMap<T, Integer>();
buildMap(a, coeffs);
for (T t : b) {
...
booleanmax(List booleans)
Returns the max boolean in the booleans list.
for (boolean value : booleans) {
    if (value) {
        return true;
return false;
doublemax(List a)
max
return Collections.max(a);
doublemax(List data)
max
Collections.sort(data);
int n = data.size();
return data.get(n - 1);