Class BuiltinBitSet

  • All Implemented Interfaces:
    BitSet

    public class BuiltinBitSet
    extends java.lang.Object
    implements BitSet
    This class is a wrapper of java's builtin BitSet.
    • Constructor Summary

      Constructors 
      Constructor Description
      BuiltinBitSet​(int nbits)
      Creates a new bit set.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear​(int index)
      Sets the bit specified by the index to false.
      boolean get​(int index)  
      void set​(int index)
      Sets the bit at the specified index to true.
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BuiltinBitSet

        public BuiltinBitSet​(int nbits)
        Creates a new bit set. All bits are initially false.
        Parameters:
        nbits - the number of bits
    • Method Detail

      • get

        public boolean get​(int index)
        Specified by:
        get in interface BitSet
        Parameters:
        index - the index of the bit to get
        Returns:
        the bit value of the specified index
      • set

        public void set​(int index)
        Description copied from interface: BitSet
        Sets the bit at the specified index to true.
        Specified by:
        set in interface BitSet
        Parameters:
        index - the index of the bit to be set
      • clear

        public void clear​(int index)
        Description copied from interface: BitSet
        Sets the bit specified by the index to false.
        Specified by:
        clear in interface BitSet
        Parameters:
        index - the index of the bit to be cleared
      • size

        public int size()
        Specified by:
        size in interface BitSet
        Returns:
        the number of bits currently in this bit set