borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.dataset 

DataFile interface

borland.jbcl.dataset.DataFile

About the DataFile interface

Properties  Methods  

Implemented by TextDataFile

This interface collects the basic behavior of all file-based data sources: loading data from and writing data to a file. These operations are often referred to as importing and exporting.

Implement this interface for new classes defining a custom file format that you want to import data from, or export data to.

The JBCL TextDataFile component implements this interface. It provides the ability to read data from a text file into the TableDataSet component, and to save data stored in any StorageDataSet class object to a text file. Its properties specify how the data is organized in the text file.


DataFile properties

*Read-only properties **Write-only properties

Properties defined in this interface

DataFile methods

Methods defined in this interface


DataFile properties

loadOnOpen

 public boolean isLoadOnOpen()
If true, the StorageDataSet will automatically load from the DataFile when the StorageDataSet is opened.

DataFile methods

load(borland.jbcl.dataset.DataSet)

  public void load(borland.jbcl.dataset.DataSet dataSet)
Loads data into the DataSet. Implementations of this method do not need to synchronize on the dataSet parameter if the asynchronous StorageDataSet methods of startLoading(), loadRow(), and endLoading() are called. If these asynchronous StorageDataSet load methods are not used, implementors should synchronize on the StorageDataSet parameter, for example
 synchronized(dataSet) {
// DataFile data load implementation
... 
}

save(borland.jbcl.dataset.DataSet)

  public void save(borland.jbcl.dataset.DataSet dataSet)
Saves the data in the DataSet. Implementations of this method should synchronize on the DataSet.getDataSet(), for example,
 synchronized(dataSet.getDataSet()) {
// DataFile data save implementation
...
}