/** * Prints the text constructed by this visitor. * * @param printWriter the print writer to be used. */ public void print(final PrintWriter printWriter) { printList(printWriter, text); }
/** * Prints the text constructed by this visitor. * * @param pw * the print writer to be used. */ public void print(final PrintWriter pw) { printList(pw, text); }
/** * Prints the text constructed by this visitor. * * @param printWriter the print writer to be used. */ public void print(final PrintWriter printWriter) { printList(printWriter, text); }
/** * Prints the given string tree. * * @param printWriter the writer to be used to print the tree. * @param list a string tree, i.e., a string list that can contain other string lists, and so on * recursively. */ static void printList(final PrintWriter printWriter, final List<?> list) { for (Object o : list) { if (o instanceof List) { printList(printWriter, (List<?>) o); } else { printWriter.print(o.toString()); } } }
/** * Prints the given string tree. * * @param printWriter the writer to be used to print the tree. * @param list a string tree, i.e., a string list that can contain other string lists, and so on * recursively. */ static void printList(final PrintWriter printWriter, final List<?> list) { for (Object o : list) { if (o instanceof List) { printList(printWriter, (List<?>) o); } else { printWriter.print(o.toString()); } } }
/** * Prints the given string tree. * * @param pw * the writer to be used to print the tree. * @param l * a string tree, i.e., a string list that can contain other * string lists, and so on recursively. */ static void printList(final PrintWriter pw, final List<?> l) { for (int i = 0; i < l.size(); ++i) { Object o = l.get(i); if (o instanceof List) { printList(pw, (List<?>) o); } else { pw.print(o.toString()); } } } }