Package au.gov.amsa.ais
Class AisNmeaMessage
- java.lang.Object
-
- au.gov.amsa.ais.AisNmeaMessage
-
public class AisNmeaMessage extends java.lang.ObjectWraps an NMEA line containing an AIS message with accessor methods.- Author:
- dxm
-
-
Constructor Summary
Constructors Constructor Description AisNmeaMessage(NmeaMessage nmea)AisNmeaMessage(java.lang.String line)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AisNmeaMessagefrom(java.lang.String line)java.lang.StringgetChannel()Returns the channel.java.lang.StringgetChecksum()Returns the checksum (last field in the NMEA line).java.lang.StringgetFormat()Returns the NMEA format (from the first column after the tag block if it exists).intgetFragmentCount()Returns the count of fragments.intgetFragmentNumber()Returns the current fragment number.AisMessagegetMessage()Returns the parsed contents of column 5 of the AIS NMEA line.NmeaMessagegetNmea()intgetPadBits()java.lang.StringgetSequentialMessageId()Returns the sequential message id.TalkergetTalker()Returns theTalkercorresponding to the first two characters of the message format type (e.g.java.lang.LonggetTime()Returns the tag block unix time value.Timestamped<AisMessage>getTimestampedMessage()Returns null if there is no timestamp otherwise returns a timestamped message.Timestamped<AisMessage>getTimestampedMessage(long defaultTime)
-
-
-
Constructor Detail
-
AisNmeaMessage
public AisNmeaMessage(java.lang.String line)
Constructor.- Parameters:
line- is an NMEA line containing an AIS message.
-
AisNmeaMessage
public AisNmeaMessage(NmeaMessage nmea)
-
-
Method Detail
-
from
public static AisNmeaMessage from(java.lang.String line)
-
getTime
public java.lang.Long getTime()
Returns the tag block unix time value.- Returns:
-
getTalker
public Talker getTalker()
Returns theTalkercorresponding to the first two characters of the message format type (e.g. AIVDM -> AI). If not present or not recognized then returnsTalker.UNKNOWN.- Returns:
- talker
-
getFormat
public java.lang.String getFormat()
Returns the NMEA format (from the first column after the tag block if it exists).- Returns:
-
getFragmentCount
public int getFragmentCount()
Returns the count of fragments.- Returns:
-
getFragmentNumber
public int getFragmentNumber()
Returns the current fragment number.- Returns:
-
getSequentialMessageId
public java.lang.String getSequentialMessageId()
Returns the sequential message id.- Returns:
-
getChannel
public java.lang.String getChannel()
Returns the channel.- Returns:
-
getPadBits
public int getPadBits()
-
getMessage
public AisMessage getMessage()
Returns the parsed contents of column 5 of the AIS NMEA line.- Returns:
-
getTimestampedMessage
public Timestamped<AisMessage> getTimestampedMessage(long defaultTime)
-
getTimestampedMessage
public Timestamped<AisMessage> getTimestampedMessage()
Returns null if there is no timestamp otherwise returns a timestamped message. Note that null is returned instead of using an Optional to reduce allocation pressures.- Returns:
- timestamped message
-
getChecksum
public java.lang.String getChecksum()
Returns the checksum (last field in the NMEA line).- Returns:
-
getNmea
public NmeaMessage getNmea()
-
-