Android Collection Empty Check isEmpty(Collection c)

Here you can find the source of isEmpty(Collection c)

Description

is null or its size is 0
 isEmpty(null)   =   true; isEmpty({})     =   true; isEmpty({1})    =   false; 

Parameter

Parameter Description
V < >
c a parameter

Return

if collection is null or its size is 0, return true, else return false.

Declaration

public static <V> boolean isEmpty(Collection<V> c) 

Method Source Code

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

public class Main {
    /**/* w  w w. j  ava2  s .c o m*/
     * is null or its size is 0
     * 
     * <pre>
     * isEmpty(null)   =   true;
     * isEmpty({})     =   true;
     * isEmpty({1})    =   false;
     * </pre>
     * 
     * @param <V>
     * @param c
     * @return if collection is null or its size is 0, return true, else return false.
     */
    public static <V> boolean isEmpty(Collection<V> c) {
        return (c == null || c.size() == 0);
    }
}

Related

  1. isEmpty(Collection collection)
  2. isEmpty(Collection collection)
  3. isEmpty(Collection list)
  4. isEmpty(Collection theCollection)
  5. isEmpty(Collection theCollection)
  6. isEmpty(final Collection collection)
  7. isNotEmpty(Collection collection)
  8. isNotEmpty(Collection list)
  9. isNotNull(Collection coll)