public final class Util extends Object
| Modifier and Type | Method and Description | 
|---|---|
static boolean | 
areEqual(int i,
        int j)
Returns true if and only if given integers are equal. 
 | 
static void | 
checkArgument(boolean b,
             String message)
Throws an AisParseException with given message if b is false. 
 | 
static void | 
checkLat(double lat)
Check lat is within allowable range as per 1371-4.pdf. 
 | 
static void | 
checkLatLong(double lat,
            double lon)
Check lat lon are withing allowable range as per 1371-4.pdf. 
 | 
static void | 
checkLong(double lon)
Check lon is within allowable range as per 1371-4.pdf. 
 | 
static void | 
checkMessageId(int messageId,
              AisMessageType... messageTypes)
Check message id corresponds to one of the given list of message types. 
 | 
protected static String | 
decodeMessage(String encodedMessage)
Returns decoded message from ascii 8 bit to 6 bit binary then to
 characters. 
 | 
static AisExtractorFactory | 
getAisExtractorFactory()
Returns singleton  
AisExtractorFactory. | 
protected static String | 
getAsciiStringFrom6BitStr(String str)
Decode 6 bit String to standard ASCII String
 
 Input is a binary string of 0 and 1 each 6 bit is a character that will
 be converted to the standard ASCII character 
 | 
protected static int | 
getValueByBinStr(String binaryString,
                boolean signed)
Get a value for specified bits from the binary string. 
 | 
static boolean | 
isClassAPositionReport(int messageId)
Returns true if and only if given messageId corresponds to a class A
 position report (message ids 1,2,3). 
 | 
protected static int getValueByBinStr(String binaryString, boolean signed)
fromBit - toBit - AisParseExceptionprotected static String decodeMessage(String encodedMessage)
encodedMessage - protected static String getAsciiStringFrom6BitStr(String str)
str - public static void checkLatLong(double lat,
                                double lon)
lat - lon - public static void checkLat(double lat)
lat - public static void checkLong(double lon)
lon - public static void checkArgument(boolean b,
                                 String message)
b - message - public static AisExtractorFactory getAisExtractorFactory()
AisExtractorFactory.public static void checkMessageId(int messageId,
                                  AisMessageType... messageTypes)
messageId - messageTypes - public static boolean areEqual(int i,
                               int j)
i - j - public static boolean isClassAPositionReport(int messageId)
messageId - Copyright © 2020. All rights reserved.