Package AIS

Class AISDataUnit

All Implemented Interfaces:
Serializable, Cloneable, Comparable

public class AISDataUnit extends PamDataUnit implements Serializable, Cloneable
See Also:
  • Field Details

    • isInRange

      protected boolean isInRange
      Flag used when a limit is placed on range. If it's clearly out of range, then this flag is set and no more updates are made from static data.

      the flag can be set false again if new position data come within range.

    • newUnit

      protected boolean newUnit
    • dataType

      protected String dataType
      AIVDM, etc.
    • stationType

      protected StationType stationType
    • messageId

      protected int messageId
      Pulled out from the start of the AIVDM string.
    • totalSentences

      protected int totalSentences
      Total number of sentences needed to transfer the message
    • sentenceNumber

      protected int sentenceNumber
      Message sentence number
    • sequentialIdentifier

      protected int sequentialIdentifier
      The "message sequential identifier" is a number from 0 to 9 that is sequentially assigned as needed. This identifier is incremented for each new multi-sentence message. The count resets to 0, after 9 is used. For radio broadcast messages requiring multiple sentences, each sentence of the message contains the same sequential identification number. The purpose of this number is to link the separate sentences containing portions of the same radio message. This allows for the possibility that other sentences might be interleaved with the message sentences that contain the complete message contents. This number also links an ABK-sentence acknowledgement to the appropriate BBM-sentence.
    • aisChannel

      protected String aisChannel
      When provided, the AIS channel is indicated as either "1" or "2." This channel indication is relative to the operating conditions of the transponder when the packet is received. This field shall be null when the channel identification is not provided.
    • charData

      protected String charData
      Contents of the M.1371 radio message using the six-bit field type

      The maximum string length of encapsulation is limited such that the total number of sentence characters does not exceed 82. This field supports a maximum of 62 valid characters for messages transferred using multiple sentences, and 63 valid characters for messages using a single sentence.

    • fillBits

      protected int fillBits
      Number of "fill-bits" added to complete the last six-bit character

      Each character in the preceding six-bit coded character string represents six binary bits. This parameter indicates the number of bits that were added to the end of the binary packet as a result of creating the last character of the string. When the coding of the last six-bit character of the message packet does not create additional "fill-bits," this value shall be set to zero. The value "0" indicates that no "fill-bits" were added. This field may not be null.

    • mmsiNumber

      public int mmsiNumber
  • Constructor Details

    • AISDataUnit

      public AISDataUnit(long timeMilliseconds)
      Constructor used in data collection - doesn't do much
    • AISDataUnit

      public AISDataUnit(long timeMillis, String charData, int fillBits)
      Constructor used when reading back from binary files.
      Parameters:
      timeMillis - time millis
      charData - 6 bit character data string
      fillBits - fill bits to ignore at end of string
  • Method Details

    • getStationtypeString

      public String getStationtypeString()
    • decodeMessage

      public boolean decodeMessage()
      Decode the binary data which are currently in a character string
      Returns:
      true if the message was decoded successfully
    • isComplete

      public boolean isComplete()
    • update

      public void update(AISDataUnit newAISUnit)
      Update an existing AIS data unit with new data.
      Parameters:
      newAISUnit -
    • clone

      protected AISDataUnit clone()
      Overrides:
      clone in class Object
    • getPositionReport

      public AISPositionReport getPositionReport()
    • findPositionReport

      public AISPositionReport findPositionReport(long timeMillis)
    • getStaticData

      public AISStaticData getStaticData()
    • getPositionReports

      public ArrayList<AISPositionReport> getPositionReports()
    • addPositionReport

      public void addPositionReport(AISPositionReport positionReport)
    • setStaticData

      public void setStaticData(AISStaticData staticData)