Class NonEmptyVirtualStorage32

  • All Implemented Interfaces:
    BitmapStorage32

    public class NonEmptyVirtualStorage32
    extends Object
    implements BitmapStorage32
    This is a BitmapStorage that can be used to determine quickly if the result of an operation is non-trivial... that is, whether there will be at least on set bit.
    Since:
    0.5.0
    Author:
    Daniel Lemire and Veronika Zenz
    • Constructor Detail

      • NonEmptyVirtualStorage32

        public NonEmptyVirtualStorage32()
    • Method Detail

      • addWord

        public void addWord​(int newData)
        If the word to be added is non-zero, a NonEmptyException exception is thrown.
        Specified by:
        addWord in interface BitmapStorage32
        Parameters:
        newData - the word
      • addLiteralWord

        public void addLiteralWord​(int newData)
        If the word to be added is non-zero, a NonEmptyException exception is thrown.
        Specified by:
        addLiteralWord in interface BitmapStorage32
        Parameters:
        newData - the word
      • addStreamOfLiteralWords

        public void addStreamOfLiteralWords​(com.googlecode.javaewah32.Buffer32 buffer,
                                            int start,
                                            int number)
        throws a NonEmptyException exception when number is greater than 0
        Specified by:
        addStreamOfLiteralWords in interface BitmapStorage32
        Parameters:
        buffer - the buffer wrapping the literal words
        start - the starting point in the array
        number - the number of literal words to add
      • addStreamOfEmptyWords

        public void addStreamOfEmptyWords​(boolean v,
                                          int number)
        If the boolean value is true and number is greater than 0, then it throws a NonEmptyException exception, otherwise, nothing happens.
        Specified by:
        addStreamOfEmptyWords in interface BitmapStorage32
        Parameters:
        v - zeros or ones
        number - how many to words add
      • addStreamOfNegatedLiteralWords

        public void addStreamOfNegatedLiteralWords​(com.googlecode.javaewah32.Buffer32 buffer,
                                                   int start,
                                                   int number)
        throws a NonEmptyException exception when number is greater than 0
        Specified by:
        addStreamOfNegatedLiteralWords in interface BitmapStorage32
        Parameters:
        buffer - the buffer wrapping the literal words
        start - the starting point in the array
        number - the number of literal words to add