|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.afcs.warts.db.DataSet
The DataSet class is responsible for loading and
presenting the data associated with some database table. Various static
load...Data()
methods are available for creating an instance
of this class with all or some subset of the data in the table.
The data is maintained internally as a map of primary key values to
non-primary values, where each set of values is stored in a
java.util.List
instance.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
Method Summary | |
java.util.Map |
getData()
Returns an unmodifiable mapping between the primary key values and non-primary key values available in the current dataset. |
java.lang.Object[][] |
getNormalisedData()
Returns a normalised array of the data in the current dataset with the rows sorted in key order. |
int |
getNumRows()
Returns the number of rows that were loaded. |
java.util.List |
getSortedKeys()
Returns an unmodifiable list containing the primary key lists for this dataset sorted in primary key order. |
TableDescription |
getTableDescription()
Returns the table that this data was loaded for. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value at the specified row and column from the dataset analysed by this instance, where the row is an index into the sorted keys. |
static DataSet |
loadCharacterData(TableDescription tableDescription)
Returns a DataSet instance containing just the character data column values from the specified table. |
static DataSet |
loadCharacterData(TableDescription tableDescription,
int maxRowsToLoad)
Returns a DataSet instance containing up to maxRowsToLoad of character data from the specified table, where the rows that will be returned are the first rows found when sorting in ascending order by the primary key columns. |
static DataSet |
loadData(TableDescription tableDescription)
Returns a DataSet instance containing all of the data from the specified table. |
static DataSet |
loadData(TableDescription tableDescription,
int maxRowsToLoad)
Returns a DataSet instance containing up to maxRowsToLoad of data from the specified table, where the rows that will be returned are the first rows found when sorting in ascending order by the primary key columns. |
static void |
multiThreadedLoading()
This changes the loading mechanism to use the multi-threaded loading system. |
java.lang.String |
toString()
Returns a text description of the current instance that can be used for debugging purposes. |
static boolean |
usingMultiThreadedLoading()
Returns true if we're using multi-threaded loading. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public java.util.Map getData()
java.util.List
instances. Note that getSortedKeys()
returns the keys from this
map in key order.
public java.lang.Object[][] getNormalisedData()
public int getNumRows()
getNumRows
in interface TabularData
public java.util.List getSortedKeys()
java.util.List
instance containing the primary key column
values. Each primary key list is also unmodifiable.
public TableDescription getTableDescription()
getTableDescription
in interface TabularData
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TabularData
rowIndex
- The row to retrieve the data from.columnIndex
- The column to retrieve the data from.
java.lang.IllegalArgumentException
- If either argument is out of bounds.public static DataSet loadData(TableDescription tableDescription)
tableDescription
- The table to load data from.
java.lang.NullPointerException
- If tableDescription is null.public static DataSet loadData(TableDescription tableDescription, int maxRowsToLoad)
tableDescription
- The table to load data from.maxRowsToLoad
- The maximum number of rows to load.
java.lang.NullPointerException
- If tableDescription is null.
java.lang.IllegalArgumentException
- If maxRowsToLoad is less than 1.public static DataSet loadCharacterData(TableDescription tableDescription)
tableDescription
- The table to load data from.
java.lang.NullPointerException
- If tableDescription is null.public static DataSet loadCharacterData(TableDescription tableDescription, int maxRowsToLoad)
tableDescription
- The table to load data from.maxRowsToLoad
- The maximum number of rows to load.
java.lang.NullPointerException
- If tableDescription is null.
java.lang.IllegalArgumentException
- If maxRowsToLoad is less than 1.public static void multiThreadedLoading()
public static boolean usingMultiThreadedLoading()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |