Class AisExtractor


  • public class AisExtractor
    extends java.lang.Object
    Utility class for extracting parts of an ais message as unsigned integers, signed integers or strings.
    Author:
    dxm
    • Constructor Summary

      Constructors 
      Constructor Description
      AisExtractor​(java.lang.String message, java.lang.Integer minLength, int padBits)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMessageId()
      Returns the message id field (the first 6 characters of the decoded message).
      int getSignedValue​(int from, int to)
      Returns a signed integer value using the bits from character position start to position stop in the decoded message.
      java.lang.String getString​(int from, int to)  
      int getValue​(int from, int to)
      Returns an unsigned integer value using the bits from character position start to position stop in the decoded message.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AisExtractor

        public AisExtractor​(java.lang.String message,
                            java.lang.Integer minLength,
                            int padBits)
        Constructor. If message once decoded is less than minLength then throws AisParseException.
        Parameters:
        message -
        minLength -
    • Method Detail

      • getMessageId

        public int getMessageId()
        Returns the message id field (the first 6 characters of the decoded message).
        Returns:
      • getValue

        public int getValue​(int from,
                            int to)
        Returns an unsigned integer value using the bits from character position start to position stop in the decoded message.
        Parameters:
        from -
        to -
        Returns:
      • getSignedValue

        public int getSignedValue​(int from,
                                  int to)
        Returns a signed integer value using the bits from character position start to position stop in the decoded message.
        Parameters:
        from -
        to -
        Returns:
      • getString

        public java.lang.String getString​(int from,
                                          int to)