Java Collection Empty isEmptyCollection(Collection collection)

Here you can find the source of isEmptyCollection(Collection collection)

Description

is Empty Collection

License

Open Source License

Declaration

public static boolean isEmptyCollection(Collection<?> collection) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2004-2010 Sunil Kamath (IcemanK).
 * All rights reserved.//from  w  w w .  ja v a 2s .co m
 * This program is made available under the terms of the Common Public License
 * v1.0 which is available at http://www.eclipse.org/legal/cpl-v10.html
 *
 * Contributors:
 *     Sunil Kamath (IcemanK) - initial API and implementation
 *******************************************************************************/

import java.util.*;

public class Main {
    public static boolean isEmptyCollection(Collection<?> collection) {
        if (collection != null) {
            return collection.size() == 0;
        }
        return true;
    }
}

Related

  1. isEmpty(final Collection source)
  2. isEmpty(final Collection v)
  3. isEmptyCollection(Collection collection)
  4. isEmptyCollection(Collection list)
  5. isEmptyCollection(Collection col)
  6. isEmptyCollection(Object obj)
  7. isEmptyCollection(Object object)
  8. isEmptyException(Collection collection)
  9. isEmptyNotesField(Collection col)

    HOME | Copyright © www.java2s.com 2016