Java Collection Dump dumpCollection(String msg, Collection c)

Here you can find the source of dumpCollection(String msg, Collection c)

Description

dump Collection

License

Open Source License

Declaration

public static void dumpCollection(String msg, Collection c) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2000, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/* ww  w .  j a v  a2s .  co  m*/
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static void dumpCollection(String msg, Collection c) {
        System.out.println("DUMPING collection: " + msg); //$NON-NLS-1$
        if (c == null) {
            System.out.println("null"); //$NON-NLS-1$
            return;
        }
        for (Iterator iter = c.iterator(); iter.hasNext();) {
            System.out.println(iter.next().toString());
        }
    }
}

Related

  1. dumpCollection(Collection collection)
  2. dumpCollection(Object[] c, StringBuilder sb, int indent)
  3. dumpCollectionCollection(Collection c)
  4. dumpList(Collection list)
  5. dumpList(StringBuffer sb, Collection slist)
  6. dumpToString(Collection c, String separator)