类 Sixbit
java.lang.Object
net.sf.marineapi.ais.util.Sixbit
AIS characters are encoded as 6 bit values concatenated into a bit array.
This class implements the higher level access to this bit array, storing
and retrieveing characters, integers, etc.
- 作者:
- Lázár József
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明get(int from, int to) Returns aBitVectorfor specified range.intgetAs17BitInt(int from, int to) Get 17-bit integer value.intgetAs18BitInt(int from, int to) Get 18-bit integer value.intgetAs27BitInt(int from, int to) Get 27-bit integer value.intgetAs28BitInt(int from, int to) Get 28-bit integer value.intgetAs8BitInt(int from, int to) Get 8-bit integer value.booleangetBoolean(int index) Return bit as boolean from the bit vector.intgetInt(int from, int to) Returns the requested bits interpreted as an integer (MSB first) from the message.Returns the full message String in sixbit encoded format.getString(int fromIndex, int toIndex) Return string from bit vectorintlength()Returns the payload length.
-
字段详细资料
-
BITS_PER_CHAR
public static final int BITS_PER_CHARNumber of bits per character- 另请参阅:
-
-
构造器详细资料
-
Sixbit
Constructor.- 参数:
payload- 6-bit encoded StringfillBits- Fill bits to be added
-
-
方法详细资料
-
get
Returns aBitVectorfor specified range.- 参数:
from- Start indexto- End index- 返回:
- BitVector for specified range.
-
length
public int length()Returns the payload length.- 返回:
- Number of payload bits.
-
getBoolean
public boolean getBoolean(int index) Return bit as boolean from the bit vector.- 参数:
index- start index of bit- 返回:
- Boolean value for specified index
-
getInt
public int getInt(int from, int to) Returns the requested bits interpreted as an integer (MSB first) from the message.- 参数:
from- begin index (inclusive)to- end index (inclusive)- 返回:
- unsigned int value
-
getAs8BitInt
public int getAs8BitInt(int from, int to) Get 8-bit integer value.- 参数:
from- Start indexto- End index- 返回:
- Integer value
-
getAs17BitInt
public int getAs17BitInt(int from, int to) Get 17-bit integer value.- 参数:
from- Start indexto- End index- 返回:
- Integer value
-
getAs18BitInt
public int getAs18BitInt(int from, int to) Get 18-bit integer value.- 参数:
from- Start indexto- End index- 返回:
- Integer value
-
getAs27BitInt
public int getAs27BitInt(int from, int to) Get 27-bit integer value.- 参数:
from- Start indexto- End index- 返回:
- Integer value
-
getAs28BitInt
public int getAs28BitInt(int from, int to) Get 28-bit integer value.- 参数:
from- Start indexto- End index- 返回:
- Integer value
-
getString
Return string from bit vector- 参数:
fromIndex- begin index (inclusive)toIndex- end index (inclusive)- 返回:
- String value
-
getPayload
Returns the full message String in sixbit encoded format.- 返回:
- Sixbit encoded String.
-