Java Collection Element Get getCollectionSize(Collection collection)

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

Description

Returns size of the incoming list

License

GNU General Public License

Parameter

Parameter Description
list a parameter

Declaration

public static int getCollectionSize(Collection<?> collection) 

Method Source Code

//package com.java2s;
/*//from   ww  w .jav a 2  s  . c om
 Pulsar
 Copyright (C) 2013-2015 eBay Software Foundation
 Licensed under the GPL v2 license.  See LICENSE for full terms.
 */

import java.util.Collection;

public class Main {
    /**
     * Returns size of the incoming list
     * 
     * @param list
     * @return
     */
    public static int getCollectionSize(Collection<?> collection) {
        if (collection == null)
            return 0;
        else
            return collection.size();
    }
}

Related

  1. getCollection(T... items)
  2. getCollectionClass(TT tt)
  3. getCollectionClosingSymbol(Collection col)
  4. getCollectionPreview(final Collection collection, int previewSize)
  5. getCollectionSize(Collection collection)
  6. getCommaDelimitedString(Collection elements)
  7. getCommaSeparatedString(Collection collection)
  8. getCommaSeparatedString(Collection values)
  9. getCommaSeparatedStringFromCollection(Collection collections)