@NotThreadSafe public class AisPacket extends Object implements Comparable<AisPacket>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AisPacket p) |
static AisPacket |
from(String stringMessage)
From ais packet.
|
static AisPacket |
fromByteArray(byte[] array)
From byte array ais packet.
|
static AisPacket |
fromByteBuffer(ByteBuffer buffer)
From byte buffer ais packet.
|
AisMessage |
getAisMessage()
Try to get AIS message from packet
|
long |
getBestTimestamp()
Returns the timestamp of the packet, or -1 if no timestamp is available.
|
String |
getStringMessage()
Gets string message.
|
List<String> |
getStringMessageLines()
Gets string message lines.
|
AisPacketTags |
getTags()
Returns the tags of the packet.
|
Date |
getTimestamp()
Try to get timestamp for packet.
|
Vdm |
getVdm()
Get existing VDM or parse one from message string
|
boolean |
isValidMessage()
Check if VDM contains a valid AIS message
|
static AisPacket |
readFromString(String messageString)
Construct AisPacket from raw packet string
|
byte[] |
toByteArray()
To byte array byte [ ].
|
AisMessage |
tryGetAisMessage()
Try get ais message ais message.
|
dk.dma.enav.model.geometry.PositionTime |
tryGetPositionTime()
Try get position time position time.
|
public static AisPacket fromByteBuffer(ByteBuffer buffer)
buffer - the bufferpublic static AisPacket fromByteArray(byte[] array)
array - the arraypublic byte[] toByteArray()
public long getBestTimestamp()
public String getStringMessage()
public List<String> getStringMessageLines()
public Vdm getVdm()
public AisPacketTags getTags()
public AisMessage tryGetAisMessage()
public AisMessage getAisMessage() throws AisMessageException, SixbitException
AisMessageException - the ais message exceptionSixbitException - the sixbit exceptionpublic boolean isValidMessage()
public Date getTimestamp()
public dk.dma.enav.model.geometry.PositionTime tryGetPositionTime()
public static AisPacket from(String stringMessage)
stringMessage - the string messagepublic static AisPacket readFromString(String messageString) throws SentenceException
messageString - the message stringSentenceException - the sentence exceptionpublic int compareTo(AisPacket p)
compareTo in interface Comparable<AisPacket>Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.