Package tethys.species
Class DataBlockSpeciesManager<T extends PamDataUnit>
java.lang.Object
tethys.species.DataBlockSpeciesManager<T>
- Direct Known Subclasses:
ClickBlockSpeciesManager
,ClickEventSpeciesManager
,DLSpeciesManager
,FixedSpeciesManager
,RWSpeciesManager
,WhistleSpeciesManager
Manage species conversion for a single datablock.
there seem to be three types of manager:
1. Datablocks which have a totally free list of species codes, such as the click detector, or whistle classifier
1a. A slight variation on this is blocks which have a list and also a default for data units which aren't classified.
2. Datablocks which have a single type which may be unknown or partially known, but we want the possibility of overriding it. e.g. the whistle detector may default to odontocete, but may be overridden to a mystecete species.
3. Datablocks with no information, or where the list from (1.) is empty.
1. Datablocks which have a totally free list of species codes, such as the click detector, or whistle classifier
1a. A slight variation on this is blocks which have a list and also a default for data units which aren't classified.
2. Datablocks which have a single type which may be unknown or partially known, but we want the possibility of overriding it. e.g. the whistle detector may default to odontocete, but may be overridden to a mystecete species.
3. Datablocks with no information, or where the list from (1.) is empty.
In all cases, we need to handle this reasonably sensibly. The code list is always the start of this and must always return something, even if it's 'unknown'.
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCheck the species map.Get all PAMGuard species codes, which may come from the DataBlockSpeciesCodes object, or the defaultSpeciesCode, or the defaultDefaultSpecies name.abstract String
getSpeciesCode
(T dataUnit) Gets a species string for a specific data unit, This is abstracted since different detectors store this in non standard ways.abstract DataBlockSpeciesCodes
Object that contains a list of species codes.getSpeciesItem
(T dataUnit) makeUniqueList
(ArrayList<String> list) Make sure all entries in an array list are unique.void
setDatablockSpeciesMap
(DataBlockSpeciesMap datablockSpeciesMap) void
setDefaultDefaultSpecies
(SpeciesMapItem defaultDefaultSpecies) void
setDefaultSpeciesCode
(String defaultName) void
-
Constructor Details
-
DataBlockSpeciesManager
-
-
Method Details
-
getSpeciesCodes
Object that contains a list of species codes. This may be fluid between configurations and may change during a session, e.g. through the addition of a new click type or changes to the whistle classifier settings.- Returns:
- object containing a list of species types.
-
getSpeciesCode
Gets a species string for a specific data unit, This is abstracted since different detectors store this in non standard ways. The result of this should be within the set provided by getSpeciesCodes() which can then be used in the DataBlockSpeciesMap to look up an itis code.- Parameters:
dataUnit
-- Returns:
- A species code for a specific data unit. May be null (e.g. for an unclassified click)
-
getSpeciesItem
-
getAllSpeciesCodes
Get all PAMGuard species codes, which may come from the DataBlockSpeciesCodes object, or the defaultSpeciesCode, or the defaultDefaultSpecies name. Ideally, at least one of these should have something, or we'll stick in an "Unknown"- Returns:
-
makeUniqueList
Make sure all entries in an array list are unique.- Parameters:
list
-- Returns:
- updated list.
-
getDatablockSpeciesMap
-
setDatablockSpeciesMap
-
showSpeciesDialog
public void showSpeciesDialog() -
getDataBlock
- Returns:
- the dataBlock
-
getDefaultDefaultSpecies
- Returns:
- the defaultSpecies
-
setDefaultDefaultSpecies
- Parameters:
defaultSpecies
- the defaultSpecies to set
-
getDefaultSpeciesCode
- Returns:
- the defaultName
-
setDefaultSpeciesCode
- Parameters:
defaultName
- the defaultName to set
-
checkSpeciesMapError
Check the species map. Only return true if every species code has a map item. Otherwise it's not safe to export.- Returns:
- null if all codes have a lookup, otherwise some sort of useful error information
-