Java Utililty Methods Collection Min

List of utility methods to do Collection Min

Description

The list of methods to do Collection Min are organized into topic(s).

Method

Tmin(Collection coll)
min
return Collections.min(coll);
Doublemin(Collection data)
min
return Collections.min(data);
doublemin(Collection doubles)
min
if (doubles.size() < 1)
    throw new IllegalArgumentException("No items in list");
Double min = Double.MAX_VALUE;
for (Double doubleVal : doubles) {
    if (doubleVal < min)
        min = doubleVal;
return min;
...
Doublemin(Collection values)
min
List<Double> filteredValues = filterNulls(values);
if (filteredValues.size() == 0)
    return null;
return Collections.min(filteredValues);
intmin(Collection a)
Find the smallest integer in a collection.
int i = Integer.MAX_VALUE;
for (int z : a)
    i = Math.min(z, i);
return i;
Numbermin(Collection list)
min
Number min = list.iterator().next();
for (Number item : list) {
    if (item.floatValue() < min.floatValue()) {
        min = item;
return min;
Stringmin(Collection strs)
min
String min = null;
for (String s : strs) {
    if (min == null || min.compareTo(s) > 0)
        min = s;
return min;
Collectionmin(Collection col)
Return a Collection of all lowest-valued T .
if (col == null || col.isEmpty())
    return null;
Collection<T> result = sizedArrayList(col.size());
Iterator<T> it = col.iterator();
T min = it.next();
result.add(min);
while (it.hasNext()) {
    T next = it.next();
...
Tmin(Collection elems)
min
T min = null;
for (T t : elems) {
    if (min == null || min.compareTo(t) > 0) {
        min = t;
return min;
Tmin(Collection values)
Returns the minimum of the given values.
T min = null;
for (T value : values) {
    if (min == null) {
        min = value;
        continue;
    @SuppressWarnings("unchecked")
    Comparable<T> comparable = (Comparable<T>) value;
...