类 Sixbit

java.lang.Object
net.sf.marineapi.ais.util.Sixbit

public class Sixbit extends Object
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
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final int
    Number of bits per character
  • 构造器概要

    构造器
    构造器
    说明
    Sixbit(String payload, int fillBits)
    Constructor.
  • 方法概要

    修饰符和类型
    方法
    说明
    get(int from, int to)
    Returns a BitVector for specified range.
    int
    getAs17BitInt(int from, int to)
    Get 17-bit integer value.
    int
    getAs18BitInt(int from, int to)
    Get 18-bit integer value.
    int
    getAs27BitInt(int from, int to)
    Get 27-bit integer value.
    int
    getAs28BitInt(int from, int to)
    Get 28-bit integer value.
    int
    getAs8BitInt(int from, int to)
    Get 8-bit integer value.
    boolean
    getBoolean(int index)
    Return bit as boolean from the bit vector.
    int
    getInt(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 vector
    int
    Returns the payload length.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • BITS_PER_CHAR

      public static final int BITS_PER_CHAR
      Number of bits per character
      另请参阅:
  • 构造器详细资料

    • Sixbit

      public Sixbit(String payload, int fillBits)
      Constructor.
      参数:
      payload - 6-bit encoded String
      fillBits - Fill bits to be added
  • 方法详细资料

    • get

      public BitVector get(int from, int to)
      Returns a BitVector for specified range.
      参数:
      from - Start index
      to - 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 index
      to - End index
      返回:
      Integer value
    • getAs17BitInt

      public int getAs17BitInt(int from, int to)
      Get 17-bit integer value.
      参数:
      from - Start index
      to - End index
      返回:
      Integer value
    • getAs18BitInt

      public int getAs18BitInt(int from, int to)
      Get 18-bit integer value.
      参数:
      from - Start index
      to - End index
      返回:
      Integer value
    • getAs27BitInt

      public int getAs27BitInt(int from, int to)
      Get 27-bit integer value.
      参数:
      from - Start index
      to - End index
      返回:
      Integer value
    • getAs28BitInt

      public int getAs28BitInt(int from, int to)
      Get 28-bit integer value.
      参数:
      from - Start index
      to - End index
      返回:
      Integer value
    • getString

      public String getString(int fromIndex, int toIndex)
      Return string from bit vector
      参数:
      fromIndex - begin index (inclusive)
      toIndex - end index (inclusive)
      返回:
      String value
    • getPayload

      public String getPayload()
      Returns the full message String in sixbit encoded format.
      返回:
      Sixbit encoded String.