Java Utililty Methods List Print

List of utility methods to do List Print

Description

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

Method

voidprint_int(List l)
prinint
for (int i = 0; i < l.size(); i++) {
    System.out.print(l.get(i));
    if (i < l.size() - 1)
        System.out.print(", ");
System.out.println();
voidprintArgument(List parameters, StringBuilder sb)
print Argument
int i = 0;
if (parameters != null) {
    for (Object param : parameters) {
        sb.append("[index:").append(i).append("|parameter:").append(param).append("|typeclass:")
                .append(param == null ? null : param.getClass().getName()).append("]");
        i++;
} else {
...
voidprintBoard(List> board)
print Board
for (int i = 0; i < board.size(); i++) {
    for (int j = 0; j < board.get(i).size(); j++) {
        System.out.print(board.get(i).get(j) + ", ");
    System.out.println("");
voidprintBox(List data)
print a box
if (data == null || data.size() <= 0) {
    return;
int size = 0;
for (String line : data) {
    if (line.length() > size) {
        size = line.length();
int adjustedSize = size + 4; 
System.out.println(singleHorizontalLine(adjustedSize));
for (String line : data) {
    System.out.println(boxLine(line, adjustedSize));
System.out.println(singleHorizontalLine(adjustedSize));
voidprintCollection(List s)
print Collection
for (String str : s) {
    System.out.println(str);
StringprintDataPoint(List dataPoint)
print Data Point
StringBuffer sb = new StringBuffer();
for (int i = 0; i < dataPoint.size() - 1; i++) {
    sb.append("x" + i + "=" + dataPoint.get(i) + ", ");
sb.append("y=" + dataPoint.get(dataPoint.size() - 1));
System.out.println(sb.toString());
return sb.toString();
StringprintDelimited(final List list, final String delimiter)
Convert a list to a delimited string.
final StringBuilder s = new StringBuilder("");
final int size = list.size();
for (int i = 0; i < size; i++) {
    s.append(list.get(i));
    if (i < size - 1) {
        s.append(delimiter);
return s.toString();
voidprintEachLine(List list)
print Each Line
for (T entry : list) {
    System.out.println(entry);
voidprintFiredRules(List firedRules)
Sysout the list of Strings as a list of Fired rules
System.out.println("\n ==> Fired rules: " + (firedRules.size() == 0 ? " No rules fired" : ""));
for (String rule : firedRules) {
    System.out.println(rule);
voidprintInclusionFailure(String relName, List list)
Inform about the inclusion failure of a node set
System.out.println("Inclusion FAILED in " + relName + ":");
for (String element : list) {
    System.out.println(element);