Java Collection Size size(final Collection collection)

Here you can find the source of size(final Collection collection)

Description

size

License

Apache License

Declaration

public static <T> int size(final Collection<T> collection) 

Method Source Code


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

import java.util.Collection;
import java.util.Map;

public class Main {
    public static <T> int size(final Collection<T> collection) {
        return collection == null ? 0 : collection.size();
    }/*w  w  w . j av  a 2  s.c om*/

    public static <T, S> int size(final Map<T, S> map) {
        return map == null ? 0 : map.size();
    }
}

Related

  1. size(Collection coll)
  2. size(Collection collection)
  3. size(Collection values)
  4. size(Collection v)
  5. size(final Collection collection)
  6. size(final Collection items)
  7. sizeM1(Collection collection)
  8. sizeOf(Collection collection)
  9. sizeOf(Collection collection)