Package dataMap.filemaps
Class OfflineFileServer<TmapPoint extends FileDataMapPoint>
java.lang.Object
dataMap.filemaps.OfflineFileServer<TmapPoint>
- All Implemented Interfaces:
 DataStoreInfoHolder,OfflineDataStore,PamSettings,SettingsNameProvider
- Direct Known Subclasses:
 OfflineWavFileServer
public abstract class OfflineFileServer<TmapPoint extends FileDataMapPoint>
extends Object
implements OfflineDataStore, PamSettings, DataStoreInfoHolder
Functionality for handling data from files offline.
 Was just for sound files, now made more generic for any file type.
- Author:
 - Doug Gillespie
 
- 
Nested Class Summary
Nested Classes - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd a single sound file to the data mapabstract OfflineDataMap<TmapPoint> createDataMap(OfflineFileServer<TmapPoint> offlineFileServer, PamDataBlock pamDataBlock) abstract TmapPointcreateMapPoint(File file, long startTime, long endTime) Create the type specific data map point.voidCreate the offline data map.voidcreateOfflineDataMap(Window parentFrame) Create a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.findFirstMapPoint(Iterator<TmapPoint> mapIterator, long startMillis, long endMillis) Get the data location.Get the data source nameabstract FileFilterGet a file filter for the types of files in use.abstract long[]getFileStartandEndTime(File file) Get the file start and end times through whatever means are required.longgetStoreInfo(PamWorkMonitor workMonitor, boolean detail) Get information about the input store (e.g.booleanbooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) booleanrewriteIndexFile(PamDataBlock dataBlock, OfflineDataMapPoint dmp) Moved this function over from binary data store.booleansaveData(PamDataBlock dataBlock) Save data previously loaded from the store during offline viewing.voidvoidsetOfflineFileParameters(OfflineFileParameters offlineFileParameters) abstract voidsortMapEndTimes(OfflineFileServer.MapMaker mapMaker) Get the end times of map points.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PamController.OfflineDataStore
loadData 
- 
Constructor Details
- 
OfflineFileServer
- Parameters:
 offlineRawDataStore- master controlled unit - acquisition or decimator usually.fileDate- file date - passed around so that settings can be shared.
 
 - 
 - 
Method Details
- 
createDataMap
public abstract OfflineDataMap<TmapPoint> createDataMap(OfflineFileServer<TmapPoint> offlineFileServer, PamDataBlock pamDataBlock)  - 
createOfflineDataMap
Description copied from interface:OfflineDataStoreCreate a basic map of the data including first and last times and some kind of data/unit time count plus ideally some kind of start and stop time list of where there are gaps in the data.- Specified by:
 createOfflineDataMapin interfaceOfflineDataStore
 - 
createOfflineDataMap
public void createOfflineDataMap()Create the offline data map. - 
getFileFilter
Get a file filter for the types of files in use.- Returns:
 - file filter.
 
 - 
loadSerialisedMap
public boolean loadSerialisedMap() - 
saveSerialisedMap
public void saveSerialisedMap() - 
addToMap
Add a single sound file to the data map- Parameters:
 file-
 - 
getFileStartandEndTime
Get the file start and end times through whatever means are required.- Parameters:
 file-- Returns:
 - 2 element of times. Fill with 0 if no times available.
 
 - 
createMapPoint
Create the type specific data map point.- Parameters:
 file-startTime-endTime-- Returns:
 
 - 
sortMapEndTimes
Get the end times of map points. In most cases the data will have come back from the serialised file, so will already have this information so it can be skipped.- Parameters:
 mapMaker-
 - 
getDataSourceName
Description copied from interface:OfflineDataStoreGet the data source name- Specified by:
 getDataSourceNamein interfaceOfflineDataStore- Returns:
 - data source name
 
 - 
getDataLocation
Description copied from interface:OfflineDataStoreGet the data location. This may be a specific file, or might be a folder if data are in many files, a URI, etc.- Specified by:
 getDataLocationin interfaceOfflineDataStore- Returns:
 - store locations
 
 - 
findFirstMapPoint
 - 
saveData
Description copied from interface:OfflineDataStoreSave data previously loaded from the store during offline viewing.- Specified by:
 saveDatain interfaceOfflineDataStore- Parameters:
 dataBlock- datablock owner of the data- Returns:
 - true if saved or save not needed. False if an error prevents saving.
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- Returns:
 - true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
 
 - 
getOfflineFileParameters
- Returns:
 - the offlineFileParameters
 
 - 
setOfflineFileParameters
- Parameters:
 offlineFileParameters- the offlineFileParameters to set
 - 
getDataMap
- Returns:
 - the dataMap
 
 - 
getRawDataBlock
- Returns:
 - the rawDataBlock
 
 - 
rewriteIndexFile
Description copied from interface:OfflineDataStoreMoved this function over from binary data store. Many storage systems may not be able to do this, but some might !- Specified by:
 rewriteIndexFilein interfaceOfflineDataStore- Parameters:
 dataBlock-dmp-- Returns:
 
 - 
getDatagramManager
- Specified by:
 getDatagramManagerin interfaceOfflineDataStore- Returns:
 - the datagramManager
 
 - 
getOfflineRawDataStore
- Returns:
 - the offlineRawDataStore
 
 - 
getStoreInfo
Description copied from interface:DataStoreInfoHolderGet information about the input store (e.g. start times of all files).- Specified by:
 getStoreInfoin interfaceDataStoreInfoHolder- Parameters:
 workMonitor- monitor for work progress, should be called whenever a task is likely to take a long time so that a progress bar can update.detail- get detail of all files.- Returns:
 - information about data input.
 
 
 -