Class BitVector32

java.lang.Object
imagingbook.common.util.bits.BitVector32
All Implemented Interfaces:
BitVector

public class BitVector32 extends Object implements BitVector
This class implements BitVector with internal 32-bit int data.
  • Constructor Details

  • Method Details

    • getLength

      public int getLength()
      Description copied from interface: BitVector
      Returns the length of this bit vector.
      Specified by:
      getLength in interface BitVector
      Returns:
      the length of this bit vector
    • get

      public boolean get(int i)
      Description copied from interface: BitVector
      Returns true is the specified bit-element is set (1), false otherwise (0).
      Specified by:
      get in interface BitVector
      Parameters:
      i - the element index
      Returns:
      as described
    • set

      public void set(int i)
      Description copied from interface: BitVector
      Sets the specified element (to bit-value 1).
      Specified by:
      set in interface BitVector
      Parameters:
      i - the element index
    • unset

      public void unset(int i)
      Description copied from interface: BitVector
      Unsets the specified element (to bit-value 0).
      Specified by:
      unset in interface BitVector
      Parameters:
      i - the element index
    • setAll

      public void setAll()
      Description copied from interface: BitVector
      Sets all element values to 1.
      Specified by:
      setAll in interface BitVector
    • unsetAll

      public void unsetAll()
      Description copied from interface: BitVector
      Sets all element values to 0.
      Specified by:
      unsetAll in interface BitVector
    • toString

      public String toString()
      Overrides:
      toString in class Object