Java Collection Null countNonNull(Collection dist)

Here you can find the source of countNonNull(Collection dist)

Description

count Non Null

License

Open Source License

Declaration

public static int countNonNull(Collection<Double> dist) 

Method Source Code

//package com.java2s;
import java.util.Collection;

public class Main {
    public static int countNonNull(Collection<Double> dist) {
        int count = 0;
        for (Double val : dist) {
            if (val != null) {
                count++;/* w w  w.  j ava2  s.  c  o m*/
            }
        }
        return count;
    }
}

Related

  1. countNotNull(Collection collection)
  2. getItemAtPositionOrNull(Collection collection, int position)
  3. getNextNullIndex(C collection)
  4. getNumberOfNonNullElements(final Collection col)