Class OffsetBitVector

    • Constructor Detail

      • OffsetBitVector

        public OffsetBitVector()
      • OffsetBitVector

        public OffsetBitVector​(int offset,
                               int nbits)
        Creates an empty string with the specified size.
        Parameters:
        nbits - the size of the string
      • OffsetBitVector

        public OffsetBitVector​(OffsetBitVector s)
        Creates a copy of a Bit String
        Parameters:
        s - the string to copy
        Throws:
        java.lang.IllegalArgumentException - if s is null
    • Method Detail

      • getOffset

        public int getOffset()
      • get

        public final boolean get​(int bit)
        Gets a bit.
        Specified by:
        get in class BitVectorBase<OffsetBitVector>
        Parameters:
        bit - the bit to be gotten
      • not

        public final void not()
        Logically NOT this bit string
      • length

        public final int length()
        Calculates and returns the set's size in bits. The maximum element in the set is the size - 1st element.
        Specified by:
        length in class BitVectorBase<OffsetBitVector>
      • setAll

        public final void setAll()
        Sets all bits.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this object against the specified object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to compare with
        Returns:
        true if the objects are the same; false otherwise.
      • intersectionEmpty

        public final boolean intersectionEmpty​(OffsetBitVector set)
                                        throws java.lang.IllegalArgumentException
        Check if the intersection of the two sets is empty
        Specified by:
        intersectionEmpty in class BitVectorBase<OffsetBitVector>
        Parameters:
        set - the set to check intersection with
        Throws:
        java.lang.IllegalArgumentException - if set == null
      • sameBits

        public final boolean sameBits​(OffsetBitVector set)
                               throws java.lang.IllegalArgumentException
        Compares this object against the specified object.
        Specified by:
        sameBits in class BitVectorBase<OffsetBitVector>
        Parameters:
        set - the object to compare with
        Returns:
        true if the objects are the same; false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if set == null
      • copyBits

        public final void copyBits​(OffsetBitVector set)
        Copies the values of the bits in the specified set into this set.
        Parameters:
        set - the bit set to copy the bits from
        Throws:
        java.lang.IllegalArgumentException - if set is null
      • and

        public final void and​(OffsetBitVector set)
                       throws java.lang.IllegalArgumentException
        Logically ANDs this bit set with the specified set of bits.
        Specified by:
        and in class BitVectorBase<OffsetBitVector>
        Parameters:
        set - the bit set to be ANDed with
        Throws:
        java.lang.IllegalArgumentException - if set == null
      • or

        public final void or​(OffsetBitVector set)
                      throws java.lang.IllegalArgumentException
        Logically ORs this bit set with the specified set of bits.
        Specified by:
        or in class BitVectorBase<OffsetBitVector>
        Parameters:
        set - the bit set to be ORed with
        Throws:
        java.lang.IllegalArgumentException - if set == null
      • xor

        public final void xor​(OffsetBitVector set)
                       throws java.lang.IllegalArgumentException
        Logically XORs this bit set with the specified set of bits.
        Specified by:
        xor in class BitVectorBase<OffsetBitVector>
        Parameters:
        set - the bit set to be XORed with
        Throws:
        java.lang.IllegalArgumentException - if set == null
      • and

        public static OffsetBitVector and​(OffsetBitVector b1,
                                          OffsetBitVector b2)
                                   throws java.lang.IllegalArgumentException
        Return a new bit string as the AND of two others.
        Throws:
        java.lang.IllegalArgumentException - if b2 == null
      • or

        public static OffsetBitVector or​(OffsetBitVector b1,
                                         OffsetBitVector b2)
                                  throws java.lang.IllegalArgumentException
        Return a new FixedSizeBitVector as the OR of two others
        Throws:
        java.lang.IllegalArgumentException - if b2 == null