Package com.googlecode.javaewah
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
- Author:
- Daniel Lemire and Veronika Zenz
-
-
Constructor Summary
Constructors Constructor Description NonEmptyVirtualStorage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLiteralWord(long newData)If the word to be added is non-zero, a NonEmptyException exception is thrown.voidaddStreamOfEmptyWords(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.voidaddStreamOfLiteralWords(com.googlecode.javaewah.Buffer buffer, int start, int number)throws a NonEmptyException exception when number is greater than 0voidaddStreamOfNegatedLiteralWords(com.googlecode.javaewah.Buffer buffer, int start, int number)throws a NonEmptyException exception when number is greater than 0voidaddWord(long newData)If the word to be added is non-zero, a NonEmptyException exception is thrown.voidclear()Empties the container.voidsetSizeInBitsWithinLastWord(int bits)Does nothing.
-
-
-
Method Detail
-
addWord
public void addWord(long newData)
If the word to be added is non-zero, a NonEmptyException exception is thrown.- Specified by:
addWordin interfaceBitmapStorage- Parameters:
newData- the word- See Also:
BitmapStorage.addWord(long)
-
addLiteralWord
public void addLiteralWord(long newData)
If the word to be added is non-zero, a NonEmptyException exception is thrown.- Specified by:
addLiteralWordin interfaceBitmapStorage- Parameters:
newData- the word- See Also:
BitmapStorage.addWord(long)
-
addStreamOfLiteralWords
public void addStreamOfLiteralWords(com.googlecode.javaewah.Buffer buffer, int start, int number)throws a NonEmptyException exception when number is greater than 0- Specified by:
addStreamOfLiteralWordsin interfaceBitmapStorage- Parameters:
buffer- the buffer wrapping the literal wordsstart- the starting point in the arraynumber- 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:
addStreamOfEmptyWordsin interfaceBitmapStorage- Parameters:
v- zeros or onesnumber- how many to words add- See Also:
BitmapStorage.addStreamOfEmptyWords(boolean, long)
-
addStreamOfNegatedLiteralWords
public void addStreamOfNegatedLiteralWords(com.googlecode.javaewah.Buffer buffer, int start, int number)throws a NonEmptyException exception when number is greater than 0- Specified by:
addStreamOfNegatedLiteralWordsin interfaceBitmapStorage- Parameters:
buffer- the buffer wrapping the literal wordsstart- the starting point in the arraynumber- the number of literal words to add
-
clear
public void clear()
Description copied from interface:BitmapStorageEmpties the container.- Specified by:
clearin interfaceBitmapStorage
-
setSizeInBitsWithinLastWord
public void setSizeInBitsWithinLastWord(int bits)
Does nothing.- Specified by:
setSizeInBitsWithinLastWordin interfaceBitmapStorage- Parameters:
bits- the size in bits- See Also:
BitmapStorage.setSizeInBitsWithinLastWord(int)
-
-