Package dataMap.filemaps
Class OfflineFileServer<TmapPoint extends FileDataMapPoint>
java.lang.Object
dataMap.filemaps.OfflineFileServer<TmapPoint>
- All Implemented Interfaces:
OfflineDataStore
,PamSettings
,SettingsNameProvider
- Direct Known Subclasses:
OfflineWavFileServer
public abstract class OfflineFileServer<TmapPoint extends FileDataMapPoint>
extends Object
implements OfflineDataStore, PamSettings
Functionality for handling data from files offline.
Was just for sound files, now made more generic for any file type.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract OfflineDataMap<TmapPoint>
createDataMap
(OfflineFileServer<TmapPoint> offlineFileServer, PamDataBlock pamDataBlock) abstract TmapPoint
createMapPoint
(File file, long startTime, long endTime) Create the type specific data map point.void
Create the offline data map.void
createOfflineDataMap
(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 FileFilter
Get 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.long
boolean
boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) boolean
rewriteIndexFile
(PamDataBlock dataBlock, OfflineDataMapPoint dmp) Moved this function over from binary data store.boolean
saveData
(PamDataBlock dataBlock) Save data previously loaded from the store during offline viewing.void
void
setOfflineFileParameters
(OfflineFileParameters offlineFileParameters) abstract void
Get the end times of map points.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:OfflineDataStore
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.- Specified by:
createOfflineDataMap
in 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() -
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
public abstract void 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. -
getDataSourceName
Description copied from interface:OfflineDataStore
Get the data source name- Specified by:
getDataSourceName
in interfaceOfflineDataStore
- Returns:
- data source name
-
getDataLocation
Description copied from interface:OfflineDataStore
Get 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:
getDataLocation
in interfaceOfflineDataStore
- Returns:
- store locations
-
findFirstMapPoint
-
saveData
Description copied from interface:OfflineDataStore
Save data previously loaded from the store during offline viewing.- Specified by:
saveData
in 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:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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:OfflineDataStore
Moved this function over from binary data store. Many storage systems may not be able to do this, but some might !- Specified by:
rewriteIndexFile
in interfaceOfflineDataStore
- Returns:
-
getDatagramManager
- Specified by:
getDatagramManager
in interfaceOfflineDataStore
- Returns:
- the datagramManager
-
getOfflineRawDataStore
- Returns:
- the offlineRawDataStore
-