org.dbunit.dataset
Class AbstractDataSet

java.lang.Object
  extended by org.dbunit.dataset.AbstractDataSet
All Implemented Interfaces:
IDataSet
Direct Known Subclasses:
CachedDataSet, CaseInsensitiveDataSet, CompositeDataSet, DatabaseDataSet, DefaultDataSet, FilteredDataSet, FlatDtdDataSet, ForwardOnlyDataSet, LowerCaseDataSet, QueryDataSet, ReplacementDataSet, SortedDataSet, StreamingDataSet, XlsDataSet

public abstract class AbstractDataSet
extends java.lang.Object
implements IDataSet

This abstract class provides the basic implementation of the IDataSet interface. Subclass are only required to implement the createIterator(boolean) method.

Since:
1.0 (Feb 22, 2002)
Version:
$Revision: 1014 $ $Date: 2009-06-01 20:44:23 +0200 (lun, 01 giu 2009) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Field Summary
protected  OrderedTableNameMap _orderedTableNameMap
           
 
Constructor Summary
AbstractDataSet()
          Default constructor
AbstractDataSet(boolean caseSensitiveTableNames)
          Constructor
 
Method Summary
protected abstract  ITableIterator createIterator(boolean reversed)
          Creates an iterator which provides access to all tables of this dataset
protected  OrderedTableNameMap createTableNameMap()
          Creates and returns a new instance of the table names container.
 ITable getTable(java.lang.String tableName)
          Returns the specified table.
 ITableMetaData getTableMetaData(java.lang.String tableName)
          Returns the specified table metadata.
 java.lang.String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 ITable[] getTables()
          Returns tables in this dataset in proper sequence.
 boolean isCaseSensitiveTableNames()
          Whether or not this dataset handles table names in a case sensitive way or not.
 ITableIterator iterator()
          Returns an iterator over the tables in this dataset in proper sequence.
 ITableIterator reverseIterator()
          Returns an iterator over the tables in this dataset in reverse sequence.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_orderedTableNameMap

protected OrderedTableNameMap _orderedTableNameMap
Constructor Detail

AbstractDataSet

public AbstractDataSet()
Default constructor


AbstractDataSet

public AbstractDataSet(boolean caseSensitiveTableNames)
Constructor

Parameters:
caseSensitiveTableNames - Whether or not table names should be case sensitive
Since:
2.4
Method Detail

isCaseSensitiveTableNames

public boolean isCaseSensitiveTableNames()
Description copied from interface: IDataSet
Whether or not this dataset handles table names in a case sensitive way or not.

Specified by:
isCaseSensitiveTableNames in interface IDataSet
Returns:
true if the case sensitivity of table names is used in this dataset.
Since:
2.4

createTableNameMap

protected OrderedTableNameMap createTableNameMap()
Creates and returns a new instance of the table names container. Implementors should use this method to retrieve a map which stores table names which can be linked with arbitrary objects.

Returns:
a new empty instance of the table names container
Since:
2.4

createIterator

protected abstract ITableIterator createIterator(boolean reversed)
                                          throws DataSetException
Creates an iterator which provides access to all tables of this dataset

Parameters:
reversed - Whether the created iterator should be a reversed one or not
Returns:
The created ITableIterator
Throws:
DataSetException

getTableNames

public java.lang.String[] getTableNames()
                                 throws DataSetException
Description copied from interface: IDataSet
Returns names of tables in this dataset in proper sequence. Multiple occurrence of the same name may be returned if multiple tables having the same name are present in the dataset.

Specified by:
getTableNames in interface IDataSet
Throws:
DataSetException

getTableMetaData

public ITableMetaData getTableMetaData(java.lang.String tableName)
                                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table metadata.

Specified by:
getTableMetaData in interface IDataSet
Throws:
NoSuchTableException - if dataset do not contains the specified table
DataSetException

getTable

public ITable getTable(java.lang.String tableName)
                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table.

Specified by:
getTable in interface IDataSet
Throws:
NoSuchTableException - if dataset do not contains the specified table
DataSetException

getTables

public ITable[] getTables()
                   throws DataSetException
Description copied from interface: IDataSet
Returns tables in this dataset in proper sequence. Multiple tables having the same name but different data may be returned.

Specified by:
getTables in interface IDataSet
Throws:
DataSetException

iterator

public ITableIterator iterator()
                        throws DataSetException
Description copied from interface: IDataSet
Returns an iterator over the tables in this dataset in proper sequence.

Specified by:
iterator in interface IDataSet
Throws:
DataSetException

reverseIterator

public ITableIterator reverseIterator()
                               throws DataSetException
Description copied from interface: IDataSet
Returns an iterator over the tables in this dataset in reverse sequence.

Specified by:
reverseIterator in interface IDataSet
Throws:
DataSetException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2002-2010. All Rights Reserved.