Add fullCopy from
@@ -484,6 +484,23 @@ public class Table implements Relation, IntIterable {
return column.getString(r);
}
+ /**
+ * Returns a table with the same columns as this table
+ */
+ public Table fullCopy() {
+ Table copy = new Table(name);
+ for (Column column : columnList) {
+ copy.addColumn(column.emptyCopy());
+ }
+
+ IntArrayList integers = new IntArrayList();
+ for(int i = 0; i < rowCount(); i++)
+ integers.add(i);
+ Rows.copyRowsToTable(integers,this,copy);
+
+ return copy;
+ }
+
/**
* Returns a table with the same columns as this table, but no data
*/
