1 21 package org.dbunit.dataset; 22 23 28 public class ForwardOnlyTable implements ITable 29 { 30 private final ITable _table; 31 private int _lastRow = -1; 32 33 public ForwardOnlyTable(ITable table) 34 { 35 _table = table; 36 } 37 38 41 public ITableMetaData getTableMetaData() 42 { 43 return _table.getTableMetaData(); 44 } 45 46 public int getRowCount() 47 { 48 throw new UnsupportedOperationException (); 49 } 50 51 public Object getValue(int row, String column) throws DataSetException 52 { 53 if (row < _lastRow) 54 { 55 throw new UnsupportedOperationException ("Cannot go backward!"); 56 } 57 58 _lastRow = row; 59 return _table.getValue(row, column); 60 } 61 } 62 | Popular Tags |