Class NonEmptyVirtualStorage

java.lang.Object
com.googlecode.javaewah.NonEmptyVirtualStorage
All Implemented Interfaces:
BitmapStorage

public class NonEmptyVirtualStorage extends 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
  • Field Details

  • Constructor Details

    • NonEmptyVirtualStorage

      public NonEmptyVirtualStorage()
  • Method Details

    • addWord

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

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

      public void addStreamOfLiteralWords(Buffer buffer, int start, int number)
      throws a NonEmptyException exception when number is greater than 0
      Specified by:
      addStreamOfLiteralWords in interface BitmapStorage
      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, long 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 BitmapStorage
      Parameters:
      v - zeros or ones
      number - how many to words add
      See Also:
    • addStreamOfNegatedLiteralWords

      public void addStreamOfNegatedLiteralWords(Buffer buffer, int start, int number)
      throws a NonEmptyException exception when number is greater than 0
      Specified by:
      addStreamOfNegatedLiteralWords in interface BitmapStorage
      Parameters:
      buffer - the buffer wrapping the literal words
      start - the starting point in the array
      number - the number of literal words to add
    • clear

      public void clear()
      Description copied from interface: BitmapStorage
      Empties the container.
      Specified by:
      clear in interface BitmapStorage
    • setSizeInBitsWithinLastWord

      public void setSizeInBitsWithinLastWord(int bits)
      Does nothing.
      Specified by:
      setSizeInBitsWithinLastWord in interface BitmapStorage
      Parameters:
      bits - the size in bits
      See Also: