List of utility methods to do Collection Print
void | printCollection(String name, Collection extends Object> collection) print Collection StringBuilder sb = new StringBuilder(); sb.append(name); sb.append(": ["); java.util.Iterator<? extends Object> it = collection.iterator(); int i = 0; while (it.hasNext()) { sb.append(it.next()); if (i < collection.size() - 1) ... |
void | printCollectionDebug(Collection c) print Collection Debug System.out.println(c.size() + ": " + c);
|
String | printCollectionSorted(Collection l, String indent) print Collection Sorted List sortedCollection = new ArrayList(l); Collections.sort(sortedCollection); return printCollection(sortedCollection, indent); |
String | printElement(Collection> pCollection, boolean pAllElement) For Testing use. int size = pCollection.size(); if (!pAllElement && size > 10) { size = 10; StringBuffer buf = new StringBuffer(); Iterator<?> iter = pCollection.iterator(); for (int i = 0; i < size; i++) { buf.append(i).append("= ").append(iter.next()).append(ANEMPTYSPACE); ... |
void | printElementsUnderCollection(Collection> collection) Prints the elements under collection. for (Object object : collection) {
System.out.println(object);
|
void | printList(Collection> collection) print List System.out.print("[ "); for (Object value : collection) System.out.print(value + ",\t"); System.out.println(" ]"); |
void | println(Collection extends Object> lines, String suffix, String prefix) println System.out.println(toString(lines, suffix, prefix)); |
void | printMatrixList(Collection extends Object[][]> collection) print Matrix List System.out.println("*** Start of list"); for (Object[][] matrix : collection) { printMatrix(matrix); System.out.println("-----"); System.out.println("*** End of list"); |
void | printObjectArray(Collection valueArrays) print Object Array System.out.println("["); for (Iterator iterator = valueArrays.iterator(); iterator.hasNext();) { Object[] values = (Object[]) iterator.next(); System.out.print("["); for (int i = 0; i < values.length; i++) { Object value = values[i]; System.out.print(value); if ((i + 1) < values.length) ... |