simtools.data
Class AsciiFileDataSourceProvider

java.lang.Object
  extended by simtools.data.FileDataSourceProvider
      extended by simtools.data.AsciiFileDataSourceProvider
All Implemented Interfaces:
DataSourceProvider

public class AsciiFileDataSourceProvider
extends FileDataSourceProvider

Provider for simtools AsciiFileDataSourceCollection Default mechanism is to restore the file if it can be found in the current directory, or do nothing. Subclasses are strongly encouraged to overload chooseFile() and use a file chooser (if in graphic mode) or system input, or whatever.

Version:
1.0 2001
Author:
Nicolas Brodu

Field Summary
 
Fields inherited from class simtools.data.FileDataSourceProvider
CANCEL_OPTION, chooseAgain, filter, marker, NO_OPTION, YES_OPTION
 
Constructor Summary
AsciiFileDataSourceProvider()
           
 
Method Summary
protected  DataSourceCollection createCollection(java.io.File f, int granularity, int subsampling)
           
protected  DataSourceCollection createCollection(java.io.File f, java.lang.Object optionalInformation)
           
protected  DataSource createEmptyDatasource(java.lang.String dsId, java.lang.String dscId, java.lang.Object optionalInformation)
           
 java.lang.Object getOptionalInformation(DataSource ds, DataSourceCollection dsc)
          Asks this provider some optional information about a datasource and possibly its collection.
 
Methods inherited from class simtools.data.FileDataSourceProvider
chooseFile, chooseUseCollection, chooseUseCollectionIfMissingDs, getChooseFileAgain, provide, setChooseFileAgain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiFileDataSourceProvider

public AsciiFileDataSourceProvider()
Method Detail

createCollection

protected DataSourceCollection createCollection(java.io.File f,
                                                java.lang.Object optionalInformation)
Overrides:
createCollection in class FileDataSourceProvider

getOptionalInformation

public java.lang.Object getOptionalInformation(DataSource ds,
                                               DataSourceCollection dsc)
Description copied from interface: DataSourceProvider
Asks this provider some optional information about a datasource and possibly its collection.

Specified by:
getOptionalInformation in interface DataSourceProvider
Overrides:
getOptionalInformation in class FileDataSourceProvider
Parameters:
ds - The datasource
dsc - The datasource collection, or null.
Returns:
null if this provider cannot provide optional information, an arbitrary object otherwise.

createCollection

protected DataSourceCollection createCollection(java.io.File f,
                                                int granularity,
                                                int subsampling)
                                         throws java.io.IOException,
                                                AsciiFileDataSourceCollection.InvalidFormatException
Throws:
java.io.IOException
AsciiFileDataSourceCollection.InvalidFormatException

createEmptyDatasource

protected DataSource createEmptyDatasource(java.lang.String dsId,
                                           java.lang.String dscId,
                                           java.lang.Object optionalInformation)
Specified by:
createEmptyDatasource in class FileDataSourceProvider