Package au.gov.amsa.ais
Class AisExtractor
- java.lang.Object
-
- au.gov.amsa.ais.AisExtractor
-
public class AisExtractor extends java.lang.ObjectUtility 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 intgetMessageId()Returns the message id field (the first 6 characters of the decoded message).intgetSignedValue(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.StringgetString(int from, int to)intgetValue(int from, int to)Returns an unsigned integer value using the bits from character position start to position stop in the decoded message.
-
-
-
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 throwsAisParseException.- 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)
-
-