Java Utililty Methods ArrayList Print

List of utility methods to do ArrayList Print

Description

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

Method

StringprettyPrintArrayList(ArrayList input)
Makes an ArrayList of Strings pretty again!
StringBuilder sb = new StringBuilder();
Iterator<String> i = input.iterator();
while (i.hasNext()) {
    String next = i.next();
    sb.append(next);
    if (i.hasNext())
        sb.append(", ");
return sb.toString();
voidprint(ArrayList array)
print
System.out.println(array);
voidprint(ArrayList tokens)
Print
for (int i = 0; i < tokens.size(); i++) {
    System.out.print(tokens.get(i) + " ");
System.out.print("\n");
voidprint(ArrayList tokens)
print
for (int i = 0; i < tokens.size(); i++) {
    System.out.print(tokens.get(i) + " ");
System.out.print("\n");
voidprint(ArrayList l)
print
String s = "[";
for (int i = 0; i < l.size(); i++) {
    s += l.get(i);
    if (i < l.size() - 1)
        s += ", ";
s += "]";
System.out.println(s);
...
voidprint(ArrayList[] al)
print
for (int i = 0; i < al[0].size(); i++) {
    System.out.print(al[0].get(i) + ":" + al[1].get(i) + "    ");
System.out.println("----------------------------------");
voidprint(ArrayList lines, int targetColumn)
print
for (String line : lines) {
    if (targetColumn >= 0)
        System.out.println(line.split(",")[targetColumn]);
    else
        System.out.println(line);
voidprint(ArrayList tokens, String symbol)
print
for (int i = 0; i < tokens.size(); i++) {
    System.out.print(tokens.get(i) + symbol);
System.out.print("\n");
voidprintArray(ArrayList array)
print Array
Iterator it = array.iterator();
while (it.hasNext()) {
    System.out.println(it.next());
voidprintArrayArray(ArrayList> matrix)
print Array Array
for (int pos = 0; pos < matrix.size(); pos++) {
    ArrayList<Integer> list = matrix.get(pos);
    if (!list.isEmpty()) {
        String output = "pos = " + pos + ": (";
        for (Integer i : list) {
            output = output + i + ",";
        System.out.println(output + ")");
...