Java Utililty Methods Collection Print

List of utility methods to do Collection Print

Description

The list of methods to do Collection Print are organized into topic(s).

Method

StringprettyPrint(Collection c)
Iterates over a collection of objects and joins them together with ", ", for display purposes.
if (c == null || c.isEmpty()) {
    return "";
StringBuilder sb = new StringBuilder();
int size = c.size();
int i = 0;
for (Object obj : c) {
    sb.append(obj);
...
StringprettyPrint(Collection input)
Pretty print of a collection.
if (input != null && !input.isEmpty()) {
    Iterator<?> it = input.iterator();
    return concatinateElements(it);
return "";
StringprettyPrint(Collection allGroups)
pretty Print
String toString = allGroups.toString();
return toString.substring(1, toString.length() - 1);
StringprettyPrintCollection(Collection collection)
pretty Print Collection
StringBuilder sb = new StringBuilder(collection.size());
for (T element : collection) {
    sb.append(element).append(COMMA);
return sb.toString();
StringBufferprettyPrintListOfClasses(Collection package1DependenciesOnPackage2)
pretty Print List Of Classes
final StringBuffer listOfClasses = new StringBuffer();
for (String javaClassName : package1DependenciesOnPackage2) {
    listOfClasses.append("\t|\t");
    listOfClasses.append(" |-- @ ");
    listOfClasses.append(javaClassName);
    listOfClasses.append("\n");
return listOfClasses;
...
voidprint(Collection c)
print
System.out.println(dumpToString(c));
voidprint(Collection c)
print
if (isEmpty(c)) {
    return;
for (Object object : c) {
Stringprint(Collection collection, String delim)
print
StringBuffer buffer = new StringBuffer();
print(buffer, collection, delim);
return buffer.toString();
Stringprint(Collection c, String separator)
print
StringBuilder b = new StringBuilder();
if (c.size() <= 0)
    return "";
Iterator<?> i = c.iterator();
b.append(i.next().toString()); 
while (i.hasNext()) {
    b.append(separator); 
    b.append(i.next().toString()); 
...
voidprint(Collection c)
print
Iterator<T> it = c.iterator();
while (it.hasNext()) {
    System.out.println(it.next());