Java Collection Count count(V matching, Collection values)

Here you can find the source of count(V matching, Collection values)

Description

count

License

Apache License

Declaration

public static <V> int count(V matching, Collection<V> values) 

Method Source Code

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

import java.util.Collection;

public class Main {
    /************************************************************************/
    public static <V> int count(V matching, Collection<V> values) {
        int count = 0;
        for (V value : values) {
            if (matching.equals(value)) {
                count++;//  w  ww.  j  av  a 2s . c  om
            }
        }
        return count;
    }
}

Related

  1. count(Collection collection)
  2. count(Collection ts, T toCount)
  3. count(final Collection collection, final ItemType item)
  4. count(final Collection blocks)
  5. count(T x0, T x1, T x2, Collection sentences)
  6. countCollectionsSize(Collection... cols)
  7. countComplement(Collection s1, Collection s2)
  8. countDuplicates(Collection items)
  9. countOverlappers(Collection distances)