mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
add print() and write() to Table and TableRow (fixes #4396)
This commit is contained in:
@@ -2590,6 +2590,19 @@ public class Table {
|
||||
public String[] getColumnTitles() {
|
||||
return table.getColumnTitles();
|
||||
}
|
||||
|
||||
public void print() {
|
||||
write(new PrintWriter(System.out));
|
||||
}
|
||||
|
||||
public void write(PrintWriter writer) {
|
||||
for (int i = 0 ; i < getColumnCount(); i++) {
|
||||
if (i != 0) {
|
||||
writer.print('\t');
|
||||
}
|
||||
writer.print(getString(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4571,4 +4584,14 @@ public class Table {
|
||||
public Table copy() {
|
||||
return new Table(rows());
|
||||
}
|
||||
|
||||
|
||||
public void write(PrintWriter writer) {
|
||||
writeTSV(writer);
|
||||
}
|
||||
|
||||
|
||||
public void print() {
|
||||
writeTSV(new PrintWriter(System.out));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user