1 21 package org.dbunit.dataset.stream; 22 23 import org.dbunit.dataset.*; 24 25 32 public class StreamingDataSet extends AbstractDataSet 33 { 34 private IDataSetProducer _source; 35 private int _iteratorCount; 36 37 public StreamingDataSet(IDataSetProducer source) 38 { 39 _source = source; 40 } 41 42 45 protected ITableIterator createIterator(boolean reversed) 46 throws DataSetException 47 { 48 if (reversed) 49 { 50 throw new UnsupportedOperationException ( 51 "Reverse iterator not supported!"); 52 } 53 54 if (_iteratorCount > 0) 55 { 56 throw new UnsupportedOperationException ( 57 "Only one iterator allowed!"); 58 } 59 60 _iteratorCount++; 61 return new StreamingIterator(_source); 62 } 63 64 67 71 public String [] getTableNames() throws DataSetException 72 { 73 throw new UnsupportedOperationException (); 74 } 75 76 80 public ITableMetaData getTableMetaData(String tableName) throws DataSetException 81 { 82 throw new UnsupportedOperationException (); 83 } 84 85 89 public ITable getTable(String tableName) throws DataSetException 90 { 91 throw new UnsupportedOperationException (); 92 } 93 94 } 95 | Popular Tags |