Java Collection Print print(Collection c)

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

Description

print

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
public static final void print(Collection c) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {

    @SuppressWarnings("unchecked")
    public static final void print(Collection c) {
        if (isEmpty(c)) {
            return;
        }/*w w  w .j  a  v a 2  s  . c  om*/
        for (Object object : c) {
        }
    }

    @SuppressWarnings("unchecked")
    public static final boolean isEmpty(Collection c) {
        return null == c || 0 == c.size() ? true : false;
    }

    public static boolean isEmpty(Collection<?>... colls) {
        boolean result = false;

        for (Collection<?> coll : colls) {
            if (null == coll || coll.isEmpty()) {
                result = true;
                break;
            }
        }

        return result;
    }

    public static boolean isEmpty(Map<?, ?>... maps) {
        boolean result = false;

        for (Map<?, ?> map : maps) {
            if (null == map || map.isEmpty()) {
                result = true;
                break;
            }
        }

        return result;
    }
}

Related

  1. prettyPrint(Collection c)
  2. prettyPrint(Collection input)
  3. prettyPrint(Collection allGroups)
  4. prettyPrintCollection(Collection collection)
  5. prettyPrintListOfClasses( Collection package1DependenciesOnPackage2)
  6. print(Collection c)
  7. print(Collection collection, String delim)
  8. print(Collection c, String separator)
  9. print(Collection c)