@ThreadSafe public final class Track extends Target implements Cloneable
Track supports dynamic storage of track properties via the getProperty()/setProperty() methods, but also contains some business logic and knowledge of what it stores; e.g. via the getMmsi(), and get/setPosition() methods.
Information which is available directly in AisPackets is stored and retrieved from these. Other information, such as cell-id's, event booking-keeping, etc. is set dynamically as custom properties.
| Modifier and Type | Field and Description |
|---|---|
static String |
CELL_ID
The constant CELL_ID.
|
static String |
EXTENT
The constant EXTENT.
|
static int |
MAX_AGE_POSITION_REPORTS_MINUTES
The constant MAX_AGE_POSITION_REPORTS_MINUTES.
|
static String |
SAFETY_ZONE
The constant SAFETY_ZONE.
|
| Constructor and Description |
|---|
Track(int mmsi)
Create a new track with the given MMSI no.
|
| Modifier and Type | Method and Description |
|---|---|
Track |
clone()
Deep copy/clone a track
|
String |
getCallsign()
Convenience method to return track's last reported callsign or null @return the callsign
|
Float |
getCourseOverGround()
Convenience method to return track's last reported COG or null @return the course over ground
|
Integer |
getIMO()
Convenience method to return track's last reported IMO no. or null @return the imo
|
AisPacket |
getLastStaticReport()
Return the last received static report (if any) @return the last static report
|
TrackingReport |
getNewestTrackingReport()
Get the most recently reported position report.
|
TrackingReport |
getOldestTrackingReport()
Get the oldest reported position report kept.
|
dk.dma.enav.model.geometry.Position |
getPosition()
Convenience method to return track's last reported position or null @return the position
|
Object |
getProperty(String propertyName)
Get a custom property previously set on this track.
|
Integer |
getShipDimensionBow()
Gets ship dimension bow.
|
Integer |
getShipDimensionPort()
Gets ship dimension port.
|
Integer |
getShipDimensionStarboard()
Gets ship dimension starboard.
|
Integer |
getShipDimensionStern()
Gets ship dimension stern.
|
String |
getShipName()
Convenience method to return track's last reported ship name or null @return the ship name
|
Integer |
getShipType()
Convenience method to return track's last reported ship type or null @return the ship type
|
Float |
getSpeedOverGround()
Convenience method to return track's last reported SOG or null @return the speed over ground
|
long |
getTimeOfLastAisTrackingReport()
Get time timestamp of the last non-predicted position report @return the time of last ais tracking report
|
LocalDateTime |
getTimeOfLastAisTrackingReportTyped()
Get time timestamp of the last non-predicted position report @return the time of last ais tracking report typed
|
long |
getTimeOfLastPositionReport()
Get the timestamp of the last position report.
|
LocalDateTime |
getTimeOfLastPositionReportTyped()
Get the timestamp of the last position report.
|
long |
getTimeOfLastUpdate()
Get the timestamp of the last update of any type.
|
LocalDateTime |
getTimeOfLastUpdateTyped()
Get the timestamp of the last update of any type.
|
TrackingReport |
getTrackingReportAt(long t)
Get the the position report at time t.
|
List<TrackingReport> |
getTrackingReports()
Get a trail of historic position reports.
|
Float |
getTrueHeading()
Convenience method to return track's last reported heading or null @return the true heading
|
Integer |
getVesselBeam()
Convenience method to return track's last reported vessel beam or null @return the vessel beam
|
Integer |
getVesselLength()
Convenience method to return track's last reported vessel length or null @return the vessel length
|
int |
hashCode() |
void |
predict(long atTime)
Predict this track's position forward to time atTime.
|
void |
removeProperty(String propertyName)
Remove a custom property previously set on this track.
|
void |
setPositionReportPurgeEnable(boolean positionReportPurgeEnable)
Enable or disable purging of old position reports from the track.
|
void |
setProperty(String propertyName,
Object propertyValue)
Attach/set a custom property on this track.
|
String |
toString() |
void |
update(AisPacket p)
Update.
|
void |
update(long timestamp,
AisMessage m)
Update this track with a new AisPacket.
|
void |
update(long timestamp,
dk.dma.enav.model.geometry.Position position,
float cog,
float sog,
float hdg)
Update this track with interpolated or predicted information (as opposed to information
received from an AIS receiver or basestation).
|
public static final String CELL_ID
public static final String SAFETY_ZONE
public static final String EXTENT
public static final int MAX_AGE_POSITION_REPORTS_MINUTES
public Track(int mmsi)
mmsi - the MMSI no. assigned to this track.public Track clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic void update(AisPacket p)
p - the ppublic void update(long timestamp,
AisMessage m)
This update is treated as an interpolated (artifical, non-real) update.
timestamp - the timestampm - the mpublic void update(long timestamp,
dk.dma.enav.model.geometry.Position position,
float cog,
float sog,
float hdg)
timestamp - the timestampposition - the positioncog - the cogsog - the soghdg - the hdgpublic Object getProperty(String propertyName)
propertyName - the property namepublic void setProperty(String propertyName, Object propertyValue)
propertyName - the property namepropertyValue - the property valuepublic void removeProperty(String propertyName)
propertyName - the property namepublic long getTimeOfLastUpdate()
public LocalDateTime getTimeOfLastUpdateTyped()
public long getTimeOfLastPositionReport()
public LocalDateTime getTimeOfLastPositionReportTyped()
public long getTimeOfLastAisTrackingReport()
public LocalDateTime getTimeOfLastAisTrackingReportTyped()
public AisPacket getLastStaticReport()
public void setPositionReportPurgeEnable(boolean positionReportPurgeEnable)
positionReportPurgeEnable - the position report purge enablepublic TrackingReport getOldestTrackingReport()
public TrackingReport getNewestTrackingReport()
public TrackingReport getTrackingReportAt(long t)
t - the tpublic List<TrackingReport> getTrackingReports()
public void predict(long atTime)
atTime - timestamp in milliseconds since the Epochpublic Integer getShipType()
public String getShipName()
public String getCallsign()
public Integer getIMO()
public Integer getVesselLength()
public Integer getVesselBeam()
public Integer getShipDimensionBow()
public Integer getShipDimensionStern()
public Integer getShipDimensionPort()
public Integer getShipDimensionStarboard()
public dk.dma.enav.model.geometry.Position getPosition()
public Float getSpeedOverGround()
public Float getCourseOverGround()
public Float getTrueHeading()
Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.