01: /*
02: *
03: * The DbUnit Database Testing Framework
04: * Copyright (C)2002-2004, DbUnit.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: */
21:
22: package org.dbunit.dataset;
23:
24: /**
25: * Represents a collection of tables.
26: *
27: * @author Manuel Laflamme
28: * @version $Revision: 398 $
29: * @since Feb 17, 2002
30: */
31: public interface IDataSet {
32: /**
33: * Returns names of tables in this dataset in proper sequence. Multiple
34: * occurence of the same name may be returned if multiple tables having
35: * the same name are present in the dataset.
36: */
37: public String[] getTableNames() throws DataSetException;
38:
39: /**
40: * Returns the specified table metadata.
41: *
42: * @throws AmbiguousTableNameException if dataset contains multiple tables
43: * having the specified name. Use {@link #iterator} to access
44: * to all tables.
45: * @throws NoSuchTableException if dataset do not contains the specified
46: * table
47: */
48: public ITableMetaData getTableMetaData(String tableName)
49: throws DataSetException;
50:
51: /**
52: * Returns the specified table.
53: *
54: * @throws AmbiguousTableNameException if dataset contains multiple tables
55: * having the specified name. Use {@link #iterator} to access
56: * to all tables.
57: * @throws NoSuchTableException if dataset do not contains the specified
58: * table
59: */
60: public ITable getTable(String tableName) throws DataSetException;
61:
62: /**
63: * Returns tables in this dataset in proper sequence. Multiple tables having
64: * the same name but different data may be returned.
65: *
66: * @deprecated Use {@link #iterator} or {@link #reverseIterator} instead.
67: */
68: public ITable[] getTables() throws DataSetException;
69:
70: /**
71: * Returns an iterator over the tables in this dataset in proper sequence.
72: */
73: public ITableIterator iterator() throws DataSetException;
74:
75: /**
76: * Returns an iterator over the tables in this dataset in reverse sequence.
77: */
78: public ITableIterator reverseIterator() throws DataSetException;
79: }
|