Skip to content

Commit fe1635f

Browse files
committed
add print() and write() to Table and TableRow (fixes #4396)
1 parent 77bf8c2 commit fe1635f

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

core/src/processing/data/Table.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,6 +2590,19 @@ public String getColumnTitle(int column) {
25902590
public String[] getColumnTitles() {
25912591
return table.getColumnTitles();
25922592
}
2593+
2594+
public void print() {
2595+
write(new PrintWriter(System.out));
2596+
}
2597+
2598+
public void write(PrintWriter writer) {
2599+
for (int i = 0 ; i < getColumnCount(); i++) {
2600+
if (i != 0) {
2601+
writer.print('\t');
2602+
}
2603+
writer.print(getString(i));
2604+
}
2605+
}
25932606
}
25942607

25952608

@@ -4571,4 +4584,14 @@ private void convertRowCol(DataOutputStream output, int row, int col, String pie
45714584
public Table copy() {
45724585
return new Table(rows());
45734586
}
4587+
4588+
4589+
public void write(PrintWriter writer) {
4590+
writeTSV(writer);
4591+
}
4592+
4593+
4594+
public void print() {
4595+
writeTSV(new PrintWriter(System.out));
4596+
}
45744597
}

core/src/processing/data/TableRow.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package processing.data;
22

3+
import java.io.PrintWriter;
4+
35
/**
46
* @webref data:composite
57
* @see Table
@@ -112,4 +114,7 @@ public interface TableRow {
112114

113115
public String getColumnTitle(int column);
114116
public String[] getColumnTitles();
117+
118+
public void write(PrintWriter writer);
119+
public void print();
115120
}

core/todo.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ X call crop() in keyArray() and valueArray() functions
99
X they're duplicates, their length is an implementation detail
1010
X normalize features and error handling between all of them
1111

12+
X add print() and write(PrintWriter) methods to Table/TableRow
13+
X https://github.com/processing/processing/issues/4396
14+
1215
_ JSONObject get() method is private
1316
_ https://github.com/processing/processing/issues/4334
1417
_ https://github.com/processing/processing/pull/4336

todo.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ X "Show usage..." does not locate keywords on correct line
4848
X https://github.com/processing/processing/issues/3988
4949
X PPS: threading enhancement
5050
X https://github.com/processing/processing/pull/4442
51+
X Move PDEX listeners from JavaEditor to PDEX
52+
X https://github.com/processing/processing/pull/4446
53+
X https://github.com/processing/processing/pull/4447
54+
X handleCtrlClick misbehaving
55+
X https://github.com/processing/processing/issues/4281
5156

5257
gottfried
5358
X Add automatic mipmap support to GLES2

0 commit comments

Comments
 (0)