Java Collection Element Get getCollectionSize(Collection collection)

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

Description

return collection size

License

Open Source License

Parameter

Parameter Description
collection <code>java.util.Collection</code>

Return

size of collection

Declaration

public static int getCollectionSize(Collection collection) 

Method Source Code

//package com.java2s;
/*//from  w  ww .j ava  2 s . c  o m
 * File: $RCSfile$
 *
 * Copyright (c) 2005 Wincor Nixdorf International GmbH,
 * Heinz-Nixdorf-Ring 1, 33106 Paderborn, Germany
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information
 * of Wincor Nixdorf ("Confidential Information"). You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered
 * into with Wincor Nixdorf.
 */

import java.util.Collection;

public class Main {
    /**
     * return collection size
     *
     * @param collection <code>java.util.Collection</code>
     * @return size of collection
     */
    public static int getCollectionSize(Collection collection) {
        return collection != null ? collection.size() : 0;
    }
}

Related

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