mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 21:59:20 +01:00
testing out a lookup function
This commit is contained in:
@@ -4418,13 +4418,13 @@ public class Table {
|
||||
|
||||
public FloatDict getFloatDict(int keyColumn, int valueColumn) {
|
||||
return new FloatDict(getStringColumn(keyColumn),
|
||||
getFloatColumn(valueColumn));
|
||||
getFloatColumn(valueColumn));
|
||||
}
|
||||
|
||||
|
||||
public StringDict getStringDict(String keyColumnName, String valueColumnName) {
|
||||
return new StringDict(getStringColumn(keyColumnName),
|
||||
getStringColumn(valueColumnName));
|
||||
getStringColumn(valueColumnName));
|
||||
}
|
||||
|
||||
|
||||
@@ -4434,6 +4434,26 @@ public class Table {
|
||||
}
|
||||
|
||||
|
||||
public Map<String, TableRow> getRowMap(String columnName) {
|
||||
int col = getColumnIndex(columnName);
|
||||
return (col == -1) ? null : getRowMap(col);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, TableRow> getRowMap(int column) {
|
||||
Map<String, TableRow> outgoing = new HashMap<>();
|
||||
for (int row = 0; row < getRowCount(); row++) {
|
||||
String id = getString(row, column);
|
||||
outgoing.put(id, new RowPointer(this, row));
|
||||
}
|
||||
// for (TableRow row : rows()) {
|
||||
// String id = row.getString(column);
|
||||
// outgoing.put(id, row);
|
||||
// }
|
||||
return outgoing;
|
||||
}
|
||||
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
0253 (3.2.1)
|
||||
X implement defaultUncaughtExceptionHandler
|
||||
X helps avoid needing to double-quit OS X applications
|
||||
X add getRowMap() function
|
||||
_ do we want rows() to not be transient?
|
||||
|
||||
|
||||
started
|
||||
|
||||
Reference in New Issue
Block a user