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

voidprintArrayList(ArrayList arr)
Prints out the ArrayList to standard output.
if (arr == null) {
    System.out.println("Null ArrayList.");
    return;
if (arr.isEmpty()) {
    System.out.println("Empty ArrayList");
    return;
for (int i = 0; i < arr.size() - 1; i++) {
    System.out.print(arr.get(i) + " ");
System.out.print(arr.get(arr.size() - 1));
System.out.println();
voidprintArrayList(ArrayList set)
print Array List
for (Object thing : set) {
    System.out.println(thing.toString());
voidprintArrayList(ArrayList list)
print Array List
if (list == null || list.isEmpty()) {
    System.out.println("\tNO ITEM !!");
    return;
for (int i = 0; i < list.size(); i++) {
    System.out.println("  " + (i + 1) + ": " + list.get(i) + "");
voidprintArrayList(ArrayList _array)
print Array List
System.out.print("[");
for (int i = 0; i < _array.size(); i++) {
    String str = _array.get(i).toString();
    System.out.print(str);
System.out.println("]");
voidprintArrayListInt(ArrayList list)
print Array List Int
for (int i = 0; i < list.size(); i++) {
    System.out.println("\t" + i + ": [" + list.get(i) + "]");
StringprintComboBoxView(ArrayList alOptionValue, String sDefaultValue)
print Combo Box View
String sCombo = sDefaultValue;
if (alOptionValue != null && !alOptionValue.isEmpty()) {
    for (int iOption = 0; iOption < alOptionValue.size(); iOption++) {
        String[] sOptionItem = (String[]) alOptionValue.get(iOption);
        if (sOptionItem != null) {
            if (sOptionItem[0].equals(sDefaultValue)) {
                sCombo = sOptionItem[1];
                break;
...
voidprintEdgeCycleMembership(final int[][] cyclesData, final ArrayList[] nodeCycleMembership)
prints edge cycle membership to System.out
for (int i = 0; i < cyclesData[1].length; i++) {
    System.out.print("Kante " + i + ":");
    for (int j = 0; j < nodeCycleMembership[i].size(); j++) {
        System.out.print(nodeCycleMembership[i].get(j).intValue() + " ");
    System.out.println();
System.out.println();
...
voidprintListFlat(ArrayList list)
print List Flat
if (list == null || list.isEmpty()) {
    System.out.println("\tNO ITEM !!");
    return;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
    if (i == 0)
        sb.append("{");
...
voidprintMatrix(ArrayList> grid)
print Matrix
for (int r = 0; r < grid.size(); r++) {
    for (int c = 0; c < grid.get(r).size(); c++)
        System.out.print(grid.get(r).get(c) + "\t");
    System.out.println();
voidprintReport(ArrayList words, ArrayList searched)
print Report
System.out.println("Example:");
for (int i = 0; i < words.size(); i++) {
    System.out.println(String.format("%5s", Integer.toBinaryString(words.get(i))).replace(' ', '0'));
System.out.println("Founded words:");
for (int i = 0; i < searched.size(); i++) {
    System.out.println(String.format("%5s", Integer.toBinaryString(searched.get(i))).replace(' ', '0'));
System.out.println();