public class NMEABitArray
extends com.sun.org.apache.xalan.internal.xsltc.dom.BitArray
Modifier and Type | Field and Description |
---|---|
static char[] |
ASCII6
Lookup table to convert from integer to 6 bit ASCII data for
AIS vessel names, destinations, etc.
|
static long |
serialVersionUID |
Constructor and Description |
---|
NMEABitArray() |
NMEABitArray(int size) |
NMEABitArray(int size,
int[] bits) |
Modifier and Type | Method and Description |
---|---|
static byte |
convert628(char ch)
converts a character from an AIS data string
into a six bit integer value packed into an
8 bit byte.
|
static char |
convert826(int n)
Convert a six bit integer value to AIS / NMEA character data
|
static byte[] |
createLUT6()
Converts the character lookup data to an integer-to-character
LUT, where the indexing is the standard ASCII character, converted to
an integer.
|
int |
getSignedInteger(int b1,
int b2)
Get a signed integer from the bit array.
|
java.lang.String |
getString(int b1,
int b2)
Gets a string based on packed bits from an AIS string
using the 6 bit ascii character set.
|
int |
getUnsignedInteger(int b1,
int b2)
Get an unsigned integer from the bit array.
|
java.lang.String |
toString() |
public static final long serialVersionUID
public static final char[] ASCII6
public NMEABitArray()
public NMEABitArray(int size, int[] bits)
public NMEABitArray(int size)
public int getUnsignedInteger(int b1, int b2)
Integers can be any number of bits. The first bit is the most significant.
b1
- First bit to unpackb2
- Last bit to unpackpublic int getSignedInteger(int b1, int b2)
Integers can be any number of bits and are stored in 2's compliment format.
b1
- First bit to unpackb2
- Last bit to unpackpublic java.lang.String getString(int b1, int b2)
b1
- First bit from AIS / NMEA datab2
- Last bit from AIS / NMEA datapublic static byte convert628(char ch)
ch
- Character from AIS or NMEA stringpublic static char convert826(int n)
n
- an six bit ascii codepublic static byte[] createLUT6()
public java.lang.String toString()
toString
in class java.lang.Object