clone method

DataSet clone([
  1. bool isDeep = false
])

Clone the data.

If isDeep is not set to true, the clone of RecordList will be a shallow copy.

Implementation

DataSet clone([bool isDeep=false]){
  DataSet ds = cloneEmpty();
  _headers.forEach((key, value){
    Record newRec = value.clone();
    ds.setHeader(newRec, key);
  });
  _recordLists.forEach((key, value){
    ds.setRecordList(value.clone(isDeep), key);
  });
  _nestedRecordSchemata.forEach((key, value){
    ds._nestedRecordSchemata[key] = value;
  });
  _nestedRecordListSchemata.forEach((key, value){
    ds._nestedRecordListSchemata[key] = value;
  });
  return ds;
}