Interface IBitmap

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      IBitmap and​(IBitmap other)
      Performs a logical AND operation between two bitmaps.
      void and​(IBitmap operand, IBitmap result)
      Performs a logical AND operation between two bitmaps.
      IBitmap andNot​(IBitmap other)
      Performs a logical AND NOT operation between two bitmaps.
      void andNot​(IBitmap operand, IBitmap result)
      Performs a logical AND NOT operation between two bitmaps.
      int cardinality()
      Reports the number of bits set in the bitmap.
      void clear()
      Clears the bitmap.
      long dataSizeInBytes()
      Estimates the size of the internal data only (without the structure costs).
      void forEachBit​(IMatchProcedure procedure)
      Executes a procedure for each of the bits that are set in the bitmap.
      boolean get​(int i)
      Returns whether the bit at the given index is set or not.
      IBitmapIterator getIterator()
      Returns an iterator.
      int getLast()
      Gets the position of the last bit set in the bitmap.
      boolean isEmpty()
      Returns whether this bitmap is empty or not.
      void not​(int sizeInBits)
      Reverses the bits in the bitmap, equivalent of the NOT logical operation.
      IBitmap or​(IBitmap other)
      Performs a logical OR operation between two bitmaps.
      void or​(IBitmap operand, IBitmap result)
      Performs a logical OR operation between two bitmaps.
      void set​(int i)
      Sets the bit at position i to true.
      long sizeInBytes()
      Gets the total size of the index.
      default IntStream stream()
      Returns a sequential IntStream with this bitmap as its source.
      static String toString​(IBitmap bitmap)
      Returns a human-readable representation of the given bitmap.
      IBitmap xor​(IBitmap other)
      Performs a logical XOR operation between two bitmaps.
      void xor​(IBitmap operand, IBitmap result)
      Performs a logical XOR operation between two bitmaps.
      • Methods inherited from interface com.quartetfs.fwk.IClone

        clone
    • Method Detail

      • set

        void set​(int i)
        Sets the bit at position i to true.

        The bits must be set in increasing order.

        Parameters:
        i - the index of the bit to set
      • get

        boolean get​(int i)
        Returns whether the bit at the given index is set or not.
        Parameters:
        i - the index of the bit
        Returns:
        true if the bit is set, false otherwise
      • getLast

        int getLast()
        Gets the position of the last bit set in the bitmap.
        Returns:
        the position of the last bit set, or -1 if no bit is set
      • clear

        void clear()
        Clears the bitmap.

        After this call the bitmap will be empty.

      • cardinality

        int cardinality()
        Reports the number of bits set in the bitmap.
        Returns:
        this bitmap cardinality
      • and

        void and​(IBitmap operand,
                 IBitmap result)
        Performs a logical AND operation between two bitmaps. It is responsibility of the user to clear the result before using this logic operation.
        Parameters:
        operand - the other bitmap operand
        result - the bitmap where the result is appended
      • and

        IBitmap and​(IBitmap other)
        Performs a logical AND operation between two bitmaps.
        Parameters:
        other - other bitmap operand of the AND operator
        Returns:
        AND result bitmap
      • or

        void or​(IBitmap operand,
                IBitmap result)
        Performs a logical OR operation between two bitmaps. It is responsibility of the user to clear the result before using this logic operation.
        Parameters:
        operand - the other bitmap operand
        result - the bitmap where the result is appended
      • or

        IBitmap or​(IBitmap other)
        Performs a logical OR operation between two bitmaps.
        Parameters:
        other - other bitmap operand of the OR operator
        Returns:
        OR result bitmap
      • xor

        void xor​(IBitmap operand,
                 IBitmap result)
        Performs a logical XOR operation between two bitmaps. It is responsibility of the user to clear the result before using this logic operation.
        Parameters:
        operand - the other bitmap operand
        result - the bitmap where the result is appended
      • xor

        IBitmap xor​(IBitmap other)
        Performs a logical XOR operation between two bitmaps.
        Parameters:
        other - other bitmap operand of the XOR operator
        Returns:
        OR result bitmap
      • andNot

        void andNot​(IBitmap operand,
                    IBitmap result)
        Performs a logical AND NOT operation between two bitmaps. It is responsibility of the user to clear the result before using this logic operation.
        Parameters:
        operand - the other bitmap operand
        result - the bitmap where the result is appended
      • andNot

        IBitmap andNot​(IBitmap other)
        Performs a logical AND NOT operation between two bitmaps.
        Parameters:
        other - other bitmap operand of the AND NOT operator
        Returns:
        OR result bitmap
      • not

        void not​(int sizeInBits)
        Reverses the bits in the bitmap, equivalent of the NOT logical operation.
        Parameters:
        sizeInBits - the size of the result, if the bitmap has a smaller size, ones will be appended, if the bitmap has a larger size, its size will be reduced
      • forEachBit

        void forEachBit​(IMatchProcedure procedure)
        Executes a procedure for each of the bits that are set in the bitmap.
        Parameters:
        procedure - procedure to apply to each value in this bitmap
      • sizeInBytes

        long sizeInBytes()
        Gets the total size of the index.

        This includes data as well as abject internal attributes, class pointers, ...

        Returns:
        estimated size of the bitmap, measured in bytes
      • dataSizeInBytes

        long dataSizeInBytes()
        Estimates the size of the internal data only (without the structure costs).
        Returns:
        size in bytes
      • isEmpty

        boolean isEmpty()
        Returns whether this bitmap is empty or not.

        A bitmap is empty iff its cardinality is equal to 0.

        Returns:
        true if this bitmap is empty, false otherwise
      • getIterator

        IBitmapIterator getIterator()
        Returns an iterator.
        Returns:
        an iterator
      • toString

        static String toString​(IBitmap bitmap)
        Returns a human-readable representation of the given bitmap.
        Parameters:
        bitmap - the bitmap to print
        Returns:
        a human-readable representation of the bitmap
      • stream

        default IntStream stream()
        Returns a sequential IntStream with this bitmap as its source.
        Returns:
        a sequential IntStream with this bitmap as its source.