类 BitVector

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

public class BitVector extends Object
Class holding bit values in an array and implementing put/get integer/string operations on it.
作者:
Lázár József
  • 构造器概要

    构造器
    构造器
    说明
    BitVector(int bits)
    Creates a new instance with given length.
    BitVector(BitSet vector)
    Creates a new instance with given BitSet and length.
  • 方法概要

    修饰符和类型
    方法
    说明
    get(int from, int to)
    Gets a vector subset.
    int
    getAs17BitInt(int from, int to)
    Convert to 17-bit integer.
    int
    getAs18BitInt(int from, int to)
    Convert to 18-bit integer.
    int
    getAs27BitInt(int from, int to)
    Convert to 27-bit integer.
    int
    getAs28BitInt(int from, int to)
    Convert to 28-bit integer.
    int
    getAs8BitInt(int from, int to)
    Convert to 8-bit integer.
    boolean
    getBoolean(int index)
    Return bit as boolean from the bit vector
    int
    getUInt(int from, int to)
    Returns the requested bits interpreted as an integer (MSB first) from the message.
    void
    set(int index)
    Set bit at given index.

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

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • BitVector

      public BitVector(int bits)
      Creates a new instance with given length.
      参数:
      bits - Vector length
    • BitVector

      public BitVector(BitSet vector)
      Creates a new instance with given BitSet and length.
      参数:
      vector - BitSet
  • 方法详细资料

    • set

      public void set(int index)
      Set bit at given index.
      参数:
      index - Index of bit to set.
    • get

      public BitVector get(int from, int to)
      Gets a vector subset.
      参数:
      from - Start index
      to - End index
      返回:
      BitVector with specified range
    • getBoolean

      public boolean getBoolean(int index)
      Return bit as boolean from the bit vector
      参数:
      index - start index of bit
      返回:
      true if bit is set, otherwise false.
    • getUInt

      public int getUInt(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)
      Convert to 8-bit integer.
      参数:
      from - Start index
      to - End index
      返回:
      Integer value
    • getAs17BitInt

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

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

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

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