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

ListgetMaxColumnSizes(List resultSet)
Gets a list of the maximum size for each column.
List<Integer> maxColumnSizes = new ArrayList<Integer>();
for (int i = 0; i < resultSet.get(0).length; i++) {
    int maxColumnSize = -1;
    for (int j = 0; j < resultSet.size(); j++) {
        if (resultSet.get(j)[i].length() > maxColumnSize) {
            maxColumnSize = resultSet.get(j)[i].length();
    maxColumnSizes.add(maxColumnSize);
return maxColumnSizes;
intgetMaxGYS(List values)
get Max GYS
int len = values.size();
if (len <= 1) {
    return 1;
} else if (len == 2) {
    return getMaxGYS(values.get(0), values.get(1));
} else {
    int v1 = values.get(0);
    int v2 = values.get(1);
...
StringgetMaxId(List ids)
get Max Id
String oozieId = ids.get(0);
int maxInt = Integer.valueOf(oozieId.split("-")[0]);
for (int i = 1; i < ids.size(); i++) {
    String currentId = ids.get(i);
    int currInt = Integer.valueOf(currentId.split("-")[0]);
    if (currInt > maxInt) {
        oozieId = currentId;
return oozieId;
ListgetMaximums(List data)
get Maximums
List<Double> xMin = new ArrayList<Double>();
List<Double> yMin = new ArrayList<Double>();
List<Double> xMax = new ArrayList<Double>();
List<Double> yMax = new ArrayList<Double>();
getPeriodBounds(data, data, xMin, yMin, xMax, yMax);
return xMax;
intgetMaxLength(List values)
get Max Length
int max = 0;
for (String value : values) {
    max = max < value.length() ? value.length() : max;
return max;
intgetMaxLineWidth(final List str)
get Max Line Width
int max = 0;
if (str != null && !str.isEmpty()) {
    for (final String s : str) {
        if (s != null && s.length() > max) {
            max = s.length();
return max;
StringgetMaxListStringFromList(List days)
get Max List String From List
String theDay = null;
for (String day : days) {
    if (theDay == null || day.compareTo(theDay) > 0) {
        theDay = day;
return theDay;
intgetMaxOf(final List list)
Useful function that return the maximum of an integer list
int max = 0;
for (final int i : list) {
    max = i > max ? i : max;
return max;
doublegetMaxOfAList(List list)
Get the maximum double of a list of array of doubles
double max = 0;
for (Double[] doubles : list) {
    Arrays.sort(doubles);
    double tempMax = doubles[doubles.length - 1];
    if (tempMax > max) {
        max = tempMax;
return max;
intgetMaxSize(final List list)
get Max Size
return list.size() > 4 ? 4 : list.size();