1 21 22 package org.dbunit.dataset; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 28 33 public class DefaultDataSet extends AbstractDataSet 34 { 35 private final List _tableList = new ArrayList (); 36 37 public DefaultDataSet() 38 { 39 } 40 41 public DefaultDataSet(ITable table) 42 { 43 addTable(table); 44 } 45 46 public DefaultDataSet(ITable[] tables) 47 { 48 for (int i = 0; i < tables.length; i++) 49 { 50 addTable(tables[i]); 51 } 52 } 53 54 public DefaultDataSet(ITable table1, ITable table2) 55 { 56 addTable(table1); 57 addTable(table2); 58 } 59 60 63 public void addTable(ITable table) 64 { 65 _tableList.add(table); 66 } 67 68 71 protected ITableIterator createIterator(boolean reversed) 72 throws DataSetException 73 { 74 ITable[] tables = (ITable[])_tableList.toArray(new ITable[0]); 75 return new DefaultTableIterator(tables, reversed); 76 } 77 } 78 79 80 81 82 83 84 | Popular Tags |