Java List Max getMaxValIndex(List vals)

Here you can find the source of getMaxValIndex(List vals)

Description

get Max Val Index

License

Open Source License

Parameter

Parameter Description
vals a parameter

Declaration

public static int getMaxValIndex(List<Double> vals) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**/*from  www. j av a2s .  c  om*/
     * @param vals
     * @return
     */
    public static int getMaxValIndex(List<Double> vals) {
        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;
    }
}

Related

  1. getMaxListStringFromList(List days)
  2. getMaxOf(final List list)
  3. getMaxOfAList(List list)
  4. getMaxSize(final List list)
  5. getMaxStrWidth(List list)
  6. getMaxValue(List list)
  7. getMaxValue(List values)
  8. max(final List aList, final Double aDefalut)
  9. max(List values)