Package au.gov.amsa.util.nmea
Class NmeaMessage
- java.lang.Object
-
- au.gov.amsa.util.nmea.NmeaMessage
-
public class NmeaMessage extends java.lang.ObjectBean to carry NMEA fields.- Author:
- dxm
-
-
Constructor Summary
Constructors Constructor Description NmeaMessage(java.util.LinkedHashMap<java.lang.String,java.lang.String> tags, java.util.List<java.lang.String> items, java.lang.String checksum)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcalculateChecksum()Returns a recalculated checksum.java.lang.LonggetArrivalTimeMillis()java.lang.StringgetChecksum()java.lang.StringgetDestination()Returns the 'd:' value from the tag block.java.util.List<java.lang.String>getItems()Returns a list of the NMEA items from the columns after the tag block.java.lang.IntegergetLineCount()Returns the 'n:' value from the tag block.java.lang.LonggetRelativeTimeMillis()Returns the 'r:' value from the tag block times 1000 to convert to millis.java.lang.IntegergetSentenceCount()java.lang.StringgetSentenceGroupId()java.lang.StringgetSentenceGroupingFromTagBlock()Returns the 'g:' value from the tag block.java.lang.IntegergetSentenceNumber()java.lang.StringgetSource()Returns the 's:' value from the tag block.java.util.LinkedHashMap<java.lang.String,java.lang.String>getTags()TalkergetTalker()java.lang.StringgetText()Returns the 't:' value from the tag block.java.lang.LonggetUnixTimeMillis()Returns the 'c:' value from the tag block times 1000 to convert to millis.booleanisSingleSentence()java.lang.StringtoLine()
-
-
-
Constructor Detail
-
NmeaMessage
public NmeaMessage(java.util.LinkedHashMap<java.lang.String,java.lang.String> tags, java.util.List<java.lang.String> items, java.lang.String checksum)Constructor.- Parameters:
tags- is a list of tags from the tag block section of an NMEA messageitems- is the list of columns from the NMEA message (not including the tag block) but including the checksum on the final column.
-
-
Method Detail
-
getSource
public java.lang.String getSource()
Returns the 's:' value from the tag block.- Returns:
-
getUnixTimeMillis
public java.lang.Long getUnixTimeMillis()
Returns the 'c:' value from the tag block times 1000 to convert to millis. Returns null if not present.- Returns:
-
getDestination
public java.lang.String getDestination()
Returns the 'd:' value from the tag block.- Returns:
-
getSentenceGroupingFromTagBlock
public java.lang.String getSentenceGroupingFromTagBlock()
Returns the 'g:' value from the tag block.- Returns:
-
getLineCount
public java.lang.Integer getLineCount()
Returns the 'n:' value from the tag block.- Returns:
-
getRelativeTimeMillis
public java.lang.Long getRelativeTimeMillis()
Returns the 'r:' value from the tag block times 1000 to convert to millis.- Returns:
-
getText
public java.lang.String getText()
Returns the 't:' value from the tag block.- Returns:
-
getItems
public java.util.List<java.lang.String> getItems()
Returns a list of the NMEA items from the columns after the tag block.- Returns:
-
getTags
public java.util.LinkedHashMap<java.lang.String,java.lang.String> getTags()
-
getTalker
public Talker getTalker()
-
toLine
public java.lang.String toLine()
-
getSentenceNumber
public java.lang.Integer getSentenceNumber()
-
getSentenceCount
public java.lang.Integer getSentenceCount()
-
getSentenceGroupId
public java.lang.String getSentenceGroupId()
-
calculateChecksum
public java.lang.String calculateChecksum()
Returns a recalculated checksum.- Returns:
- calculated checksum
-
getChecksum
public java.lang.String getChecksum()
-
isSingleSentence
public boolean isSingleSentence()
-
getArrivalTimeMillis
public java.lang.Long getArrivalTimeMillis()
-
-