Beispiel #1
0
Table.prototype.cloneWithEmptyLists = function() {
  var l = this.length;
  var i;
  var newTable = instantiateWithSameType(this);
  var newList;

  newTable.name = this.name;

  for(i = 0; i<l; i++) {
    newList = instantiateWithSameType(this[i]);
    newList.name = this[i].name;
    newTable.push(newList);
  }

  return newTable;
};
Beispiel #2
0
Table.prototype.clone = function() {
  var l = this.length;
  var clonedTable = instantiateWithSameType(this);
  var i;

  clonedTable.name = this.name;

  for(i = 0; i<l; i++) {
    clonedTable.push(this[i].clone());
  }

  return clonedTable;
};
Beispiel #3
0
Table.prototype.getListsSortedByList = function(listOrIndex, ascending) { //depracated: use sortListsByList
  if(listOrIndex == null) return;
  var newTable = instantiateWithSameType(this);
  var sortinglist = listOrIndex.isList ? listOrIndex.clone() : this[listOrIndex];
  var l = this.length;
  var i;

  //this.forEach(function(list) {
  for(i=0; i<l; i++){
    newTable.push(this[i].getSortedByList(sortinglist, ascending));
  }

  return newTable;
};