org.afcs.warts.db
Class DataSetLoader

java.lang.Object
  extended byorg.afcs.warts.db.DataSetLoader
All Implemented Interfaces:
java.lang.Runnable

public final class DataSetLoader
extends java.lang.Object
implements java.lang.Runnable

The DataSetLoader class allows the loading of the data used to create a DataSet instance to be trivially invoked in a new thread using classes from the concurrent programming library.

LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.

Version:
Last Modified 2 September 2003
Author:
Warren Hedley ( whedley at sdsc dot edu )

Constructor Summary
DataSetLoader(TableDescription tableDescription)
          Initialise a new instance to load data from the specified table.
DataSetLoader(TableDescription tableDescription, int maxRowsToLoad)
          Initialise a new instance to load up to the specified maximum number of rows from the specified table.
 
Method Summary
 DataSet getDataSet()
          Returns the dataset that was loaded when run() was called.
 void run()
          Loads the dataset for the table specified at initialisation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetLoader

public DataSetLoader(TableDescription tableDescription)
Initialise a new instance to load data from the specified table.

Parameters:
tableDescription - The table to load data from.
Throws:
java.lang.NullPointerException - If tableDescription is null.

DataSetLoader

public DataSetLoader(TableDescription tableDescription,
                     int maxRowsToLoad)
Initialise a new instance to load up to the specified maximum number of rows from the specified table.

Parameters:
tableDescription - The table to load data from.
maxRowsToLoad - The maximum number of rows to load.
Throws:
java.lang.NullPointerException - If tableDescription is null.
Method Detail

getDataSet

public DataSet getDataSet()
Returns the dataset that was loaded when run() was called. If this is called before run() is called, it will return null.

Returns:
The dataset that was loaded when run() was called.

run

public void run()
Loads the dataset for the table specified at initialisation.

Specified by:
run in interface java.lang.Runnable