Java Collection Min min(Collection elems)

Here you can find the source of min(Collection elems)

Description

min

License

Apache License

Declaration

public static <T extends Comparable<T>> T min(Collection<T> elems) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static <T extends Comparable<T>> T min(Collection<T> elems) {
        T min = null;//w  w w. j av  a 2  s.c  o m
        for (T t : elems) {
            if (min == null || min.compareTo(t) > 0) {
                min = t;
            }
        }
        return min;
    }
}

Related

  1. min(Collection values)
  2. min(Collection a)
  3. min(Collection list)
  4. min(Collection strs)
  5. min(Collection col)
  6. min(Collection values)
  7. min(Collection values)
  8. min(final Collection collection)
  9. minI(Collection col)