public abstract class PamDataUnit extends java.lang.Object implements java.lang.Comparable<PamDataUnit>
Class for units of PAM data.
PamDataUnit's are held in ArrayLists within PamDataBlocks.
When a PamDataUnit is added to a PamDataBlock any PamProcesses that subscribe to that PamDataBlock receive a notification and can retrieve the PamDataUnits from the block.
Any data derived from acoustic data should subclass from AcousticDataUnit
PamDataBlock
,
AcousticDataUnit
Constructor and Description |
---|
PamDataUnit(long timeMilliseconds) |
Modifier and Type | Method and Description |
---|---|
void |
addDataAnnotation(DataAnnotation dataAnnotation)
Adds a data annotation to the data unit.
|
void |
clearOandAngles() |
void |
clearUpdateCount()
Do a clear of update count after a database save.
|
int |
compareTo(PamDataUnit o) |
DataAnnotation |
findDataAnnotation(java.lang.Class annotationClass)
Find a data annotation that can cast to a certain type.
|
int |
getAbsBlockIndex() |
int |
getChannelBitmap() |
DataAnnotation |
getDataAnnotation(int index)
Get a data annotation.
|
int |
getDatabaseIndex() |
int |
getDatabaseUpdateOf() |
DataUnitFileInformation |
getDataUnitFileInformation() |
AbstractDetectionMatch |
getDetectionMatch() |
AbstractDetectionMatch |
getDetectionMatch(int type) |
double |
getHydrophoneHeading(boolean recalculate)
Get the hydrophone heading for the first hydrophone included in the
detection.
|
long |
getLastUpdateTime() |
AbstractLocalisation |
getLocalisation() |
int |
getNumDataAnnotations() |
GpsData |
getOriginLatLong(boolean recalculate)
Get the latlong of the mean hydrophone position at the time of
this detection.
|
double |
getPairAngle(int pair,
boolean recalculate)
Return the angle between pairs of hydrophones.
|
PamDataBlock |
getParentDataBlock() |
java.lang.String |
getSummaryString()
Return an html formatted summary string
describing the detection which can be
used in tooltips anywhere in PAMGuard.
|
long |
getTimeMilliseconds() |
int |
getUpdateCount() |
boolean |
removeDataAnnotation(DataAnnotation annotation)
Remove a data annotation
|
DataAnnotation |
removeDataAnnotation(int index)
Remove a data annotation
|
void |
setAbsBlockIndex(int absBlockIndex) |
void |
setChannelBitmap(int channelBitmap) |
void |
setDatabaseIndex(int databaseIndex) |
void |
setDatabaseUpdateOf(int databaseUpdateOf) |
void |
setDataUnitFileInformation(DataUnitFileInformation dataUnitFileInformation) |
void |
setLastUpdateTime(long lastUpdateTime) |
void |
setLocalisation(AbstractLocalisation localisation) |
void |
setOriginLatLong(GpsData oll) |
void |
setParentDataBlock(PamDataBlock parentDataBlock) |
void |
setTimeMilliseconds(long timeMilliseconds) |
void |
updateDataUnit(long updateTime) |
public void setAbsBlockIndex(int absBlockIndex)
public void setParentDataBlock(PamDataBlock parentDataBlock)
public void setTimeMilliseconds(long timeMilliseconds)
public int getAbsBlockIndex()
public PamDataBlock getParentDataBlock()
public long getTimeMilliseconds()
public void updateDataUnit(long updateTime)
public void clearUpdateCount()
public int getUpdateCount()
public int getChannelBitmap()
public void setChannelBitmap(int channelBitmap)
public GpsData getOriginLatLong(boolean recalculate)
recalculate
- public void setOriginLatLong(GpsData oll)
public double getPairAngle(int pair, boolean recalculate)
pair
- recalculate
- public double getHydrophoneHeading(boolean recalculate)
reacalculate
- force recalculationpublic void clearOandAngles()
public long getLastUpdateTime()
public void setLastUpdateTime(long lastUpdateTime)
public int getDatabaseIndex()
public void setDatabaseIndex(int databaseIndex)
public int getDatabaseUpdateOf()
public void setDatabaseUpdateOf(int databaseUpdateOf)
public DataUnitFileInformation getDataUnitFileInformation()
public void setDataUnitFileInformation(DataUnitFileInformation dataUnitFileInformation)
public int compareTo(PamDataUnit o)
compareTo
in interface java.lang.Comparable<PamDataUnit>
public AbstractLocalisation getLocalisation()
public AbstractDetectionMatch getDetectionMatch()
public AbstractDetectionMatch getDetectionMatch(int type)
public void setLocalisation(AbstractLocalisation localisation)
localisation
- The localisation to set.public java.lang.String getSummaryString()
public void addDataAnnotation(DataAnnotation dataAnnotation)
dataAnnotation
- data annotationpublic int getNumDataAnnotations()
public DataAnnotation getDataAnnotation(int index)
No array size checking so call getNumDataAnnotations first !
index
- index of data annotationpublic DataAnnotation findDataAnnotation(java.lang.Class annotationClass)
annotationClass
- class to search forpublic DataAnnotation removeDataAnnotation(int index)
index
- index of data annotationpublic boolean removeDataAnnotation(DataAnnotation annotation)
annotation
- reference to data annotation to remove.