Appends a list to the printer's buffer. List elements are rendered with repr. May be overridden by subclasses. @param list the list of objects to repr (each as with repr) @param before a string to print before the list items, e.g. an opening bracket @param separator a separator to print
(Iterable<?> list, String before, String separator, String after)
| 93 | * @param after a string to print after the list items, e.g. a closing bracket |
| 94 | */ |
| 95 | public Printer printList(Iterable<?> list, String before, String separator, String after) { |
| 96 | this.append(before); |
| 97 | String sep = ""; |
| 98 | for (Object elem : list) { |
| 99 | this.append(sep); |
| 100 | sep = separator; |
| 101 | this.repr(elem); |
| 102 | } |
| 103 | return this.append(after); |
| 104 | } |
| 105 | |
| 106 | @Override |
| 107 | public final String toString() { |