public int sizeOf() {
int nrows = getRowCount();
if (nrows == 0) return 0;
SizeEstimations sizeEstimator = SizeEstimations.lookup();
int ncells = nrows * getProperties().length;
int result = ncells * 4;
DataProperty[] props = getProperties();
for (int i = 0; i < props.length; i++) {
Object firstRowValue = getValueAt(0, i);
if (firstRowValue instanceof String) {
for (int j = 0; j < nrows; j++) {
String stringValue = (String) getValueAt(j, i);
result += sizeEstimator.sizeOfString(stringValue);
}
} else {
int singleValueSize = sizeEstimator.sizeOf(firstRowValue);
result += nrows * singleValueSize;
}
}
return result;
}