MCPcopy Index your code
hub / github.com/benfry/processing4 / createSubset

Method createSubset

core/src/processing/data/Table.java:4787–4806  ·  view source on GitHub ↗
(int[] rowSubset)

Source from the content-addressed store, hash-verified

4785
4786 // TODO naming/whether to include
4787 protected Table createSubset(int[] rowSubset) {
4788 Table newbie = new Table();
4789 newbie.setColumnTitles(columnTitles); // also sets columns.length
4790 newbie.columnTypes = columnTypes;
4791 newbie.setRowCount(rowSubset.length);
4792
4793 for (int i = 0; i < rowSubset.length; i++) {
4794 int row = rowSubset[i];
4795 for (int col = 0; col < columns.length; col++) {
4796 switch (columnTypes[col]) {
4797 case STRING: newbie.setString(i, col, getString(row, col)); break;
4798 case INT: newbie.setInt(i, col, getInt(row, col)); break;
4799 case LONG: newbie.setLong(i, col, getLong(row, col)); break;
4800 case FLOAT: newbie.setFloat(i, col, getFloat(row, col)); break;
4801 case DOUBLE: newbie.setDouble(i, col, getDouble(row, col)); break;
4802 }
4803 }
4804 }
4805 return newbie;
4806 }
4807
4808
4809 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers

nothing calls this directly

Calls 12

setColumnTitlesMethod · 0.95
setRowCountMethod · 0.95
setStringMethod · 0.95
getStringMethod · 0.95
setIntMethod · 0.95
getIntMethod · 0.95
setLongMethod · 0.95
getLongMethod · 0.95
setFloatMethod · 0.95
getFloatMethod · 0.95
setDoubleMethod · 0.95
getDoubleMethod · 0.95

Tested by

no test coverage detected