List of utility methods to do Collection Print
void | print(Collectionif (coll == null) throw new NullPointerException(); if (coll.isEmpty()) return; for (T t : coll) { System.out.println(t); |
String | print(Collection Returns a String representation of given collection, separated by comma and surrounded by square brackets. return print(elements, ",", "[", "]"); |
String | print(java.util.Collection collection) Return a String representing the elements of collection in a human readable format.
StringBuffer sb = new StringBuffer("{ "); java.util.Iterator iter = collection.iterator(); while (iter.hasNext()) { Object elem = iter.next(); sb.append(elem.toString()); if (iter.hasNext()) { sb.append(", "); sb.append(" }"); return sb.toString(); |
String | printCollection(Collection c) Utility method to print a collection. if (c != null) { StringBuffer sb = new StringBuffer("["); Iterator itr = c.iterator(); while (itr.hasNext()) { sb.append(itr.next()); if (itr.hasNext()) { sb.append(", "); sb.append("]"); return sb.toString(); } else { return "[null]"; |
void | printCollection(Collection col) Print contents of collection. if (col != null) { Iterator itr = col.iterator(); while (itr.hasNext()) { System.out.println(itr.next().toString()); |
void | printCollection(Collection collection) print Collection Iterator itr = collection.iterator(); System.out.println("-----Printing Collection-----"); while (itr.hasNext()) { System.out.println(itr.next()); System.out.println("-----End Of Collection-----"); |
String | printCollection(Collection l) print Collection return printCollection(l, ""); |
void | printCollection(Collection extends Object> col) Provides a way to print a collection for (Object next : col)
System.out.println(next.toString());
|
void | printCollection(Collection print Collection for (T t : collections) { System.out.print(t); System.out.print(" "); System.out.println(); |
void | printCollection(final Collection Helper-Method for printing a Collection in the console. int count = 1; for (T element : collection) { System.err.println(count + ".)element:" + element); count++; |