jsynoptic.builtin
Class AsciiProvider

java.lang.Object
  extended by simtools.data.FileDataSourceProvider
      extended by jsynoptic.data.DataSourceProvider
          extended by jsynoptic.builtin.AsciiProvider
All Implemented Interfaces:
DataSourceProvider

public class AsciiProvider
extends DataSourceProvider

Author:
zxpletran007

Field Summary
 
Fields inherited from class jsynoptic.data.DataSourceProvider
fileChooser, resources
 
Fields inherited from class simtools.data.FileDataSourceProvider
CANCEL_OPTION, chooseAgain, filter, marker, NO_OPTION, YES_OPTION
 
Constructor Summary
AsciiProvider()
           
 
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 id, 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.
 DataSource provide(java.lang.String id, java.lang.String dscId, java.lang.Object optionalInformation, DataSourcePool pool)
          We create Ascii Collections with buffers => same behaviour when loading an ascii file and an archive
 
Methods inherited from class jsynoptic.data.DataSourceProvider
chooseFile, chooseUseCollection, chooseUseCollectionIfMissingDs, initializeFileChooser
 
Methods inherited from class simtools.data.FileDataSourceProvider
getChooseFileAgain, setChooseFileAgain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiProvider

public AsciiProvider()
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

provide

public DataSource provide(java.lang.String id,
                          java.lang.String dscId,
                          java.lang.Object optionalInformation,
                          DataSourcePool pool)
We create Ascii Collections with buffers => same behaviour when loading an ascii file and an archive

Specified by:
provide in interface DataSourceProvider
Overrides:
provide in class FileDataSourceProvider
Parameters:
id - The symbolic id of a datasource
dscId - The symbolic id of a datasourceCollection. May be null
optionalInformation - Can be set to help this provider. May be null
pool - DataSourcePool in which to add the source and collection if they can be provided. May be null.
Returns:
The desired datasource if it can be provided, or null.

createEmptyDatasource

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