|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbunit.dataset.AbstractTable
org.dbunit.dataset.SortedTable
public class SortedTable
This is a ITable decorator that provide a sorted view of the decorated table. This implementation does not keep a separate copy of the decorated table data.
Nested Class Summary | |
---|---|
protected static class |
SortedTable.AbstractRowComparator
Abstract class for sorting the table rows of a given table in a specific order |
protected static class |
SortedTable.RowComparator
Compares the rows with each other in order to sort them in the correct order using the data type and the Comparable implementation the current column has. |
protected static class |
SortedTable.RowComparatorByString
Compares the rows with each other in order to sort them in the correct order using the string value of both values for the comparison. |
Field Summary |
---|
Fields inherited from interface org.dbunit.dataset.ITable |
---|
NO_VALUE |
Constructor Summary | |
---|---|
SortedTable(ITable table)
Sort the decorated table by its own columns order which is defined by ITable.getTableMetaData() . |
|
SortedTable(ITable table,
Column[] columns)
Sort the decorated table by specified columns order. |
|
SortedTable(ITable table,
ITableMetaData metaData)
Sort the decorated table by specified metadata columns order. |
|
SortedTable(ITable table,
String[] columnNames)
Sort the decorated table by specified columns order. |
Method Summary | |
---|---|
int |
getRowCount()
Returns this table row count. |
Column[] |
getSortColumns()
|
ITableMetaData |
getTableMetaData()
Returns this table metadata. |
Object |
getValue(int row,
String columnName)
Returns this table value for the specified row and column. |
void |
setRowComparator(SortedTable.AbstractRowComparator comparator)
Sets the comparator to be used for sorting the table rows. |
void |
setUseComparable(boolean useComparable)
Whether or not the comparable interface should be used of the compared columns instead of the plain strings Default value is false for backwards compatibility
Set whether or not to use the Comparable implementation of the corresponding column
DataType for comparing values or not. |
Methods inherited from class org.dbunit.dataset.AbstractTable |
---|
assertValidColumn, assertValidRowIndex, assertValidRowIndex, getColumnIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SortedTable(ITable table, Column[] columns) throws DataSetException
table
- decorated tablecolumns
- columns to be used for sorting
DataSetException
public SortedTable(ITable table, String[] columnNames) throws DataSetException
table
- decorated tablecolumnNames
- names of columns to be used for sorting
DataSetException
public SortedTable(ITable table, ITableMetaData metaData) throws DataSetException
table
- The decorated tablemetaData
- The metadata used to retrieve all columns which in turn are used
for sorting the table
DataSetException
public SortedTable(ITable table) throws DataSetException
ITable.getTableMetaData()
.
All table columns will be used.
table
- The decorated table
DataSetException
Method Detail |
---|
public Column[] getSortColumns()
public void setUseComparable(boolean useComparable)
false
for backwards compatibility
Set whether or not to use the Comparable implementation of the corresponding column
DataType for comparing values or not. Default value is false
which means that the old string comparison is used.
useComparable
- public void setRowComparator(SortedTable.AbstractRowComparator comparator)
comparator
- sorts the table rowspublic ITableMetaData getTableMetaData()
ITable
public int getRowCount()
ITable
public Object getValue(int row, String columnName) throws DataSetException
ITable
row
- The row index, starting with 0columnName
- The name of the column
NoSuchColumnException
- if specified column name do not exist in
this table
RowOutOfBoundsException
- if specified row is less than zero or
equals or greater than getRowCount
DataSetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |