Class NonEmptyVirtualStorage

  • All Implemented Interfaces:
    BitmapStorage

    public class NonEmptyVirtualStorage
    extends java.lang.Object
    implements BitmapStorage
    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.4.2
    Author:
    Daniel Lemire and Veronika Zenz
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long newdata)
      If the word to be added is non-zero, a NonEmptyException exception is thrown.
      void addStreamOfEmptyWords​(boolean v, long number)
      If the boolean value is true and number is greater than 0, then it throws a NonEmptyException exception, otherwise, nothing happens.
      void addStreamOfLiteralWords​(long[] data, int start, int number)
      throws a NonEmptyException exception when number is greater than 0
      void addStreamOfNegatedLiteralWords​(long[] data, int start, int number)
      throws a NonEmptyException exception when number is greater than 0
      void setSizeInBits​(int bits)
      Does nothing.
      • Methods inherited from class java.lang.Object

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

      • NonEmptyVirtualStorage

        public NonEmptyVirtualStorage()
    • Method Detail

      • add

        public void add​(long newdata)
        If the word to be added is non-zero, a NonEmptyException exception is thrown.
        Specified by:
        add in interface BitmapStorage
        Parameters:
        newdata - the word
        See Also:
        BitmapStorage.add(long)
      • addStreamOfLiteralWords

        public void addStreamOfLiteralWords​(long[] data,
                                            int start,
                                            int number)
        throws a NonEmptyException exception when number is greater than 0
        Specified by:
        addStreamOfLiteralWords in interface BitmapStorage
        Parameters:
        data - the literal words
        start - the starting point in the array
        number - the number of literal words to add
      • addStreamOfNegatedLiteralWords

        public void addStreamOfNegatedLiteralWords​(long[] data,
                                                   int start,
                                                   int number)
        throws a NonEmptyException exception when number is greater than 0
        Specified by:
        addStreamOfNegatedLiteralWords in interface BitmapStorage
        Parameters:
        data - the literal words
        start - the starting point in the array
        number - the number of literal words to add