javaewah
Class NonEmptyVirtualStorage

java.lang.Object
  extended by 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

Constructor Summary
NonEmptyVirtualStorage()
           
 
Method Summary
 int add(long newdata)
          If the word to be added is non-zero, a NonEmptyException exception is thrown.
 long addStreamOfDirtyWords(long[] data, long start, long number)
          throws a NonEmptyException exception
 int addStreamOfEmptyWords(boolean v, long number)
          If the boolean value is true, then it throws a NonEmptyException exception, otherwise, nothing happens.
 long addStreamOfNegatedDirtyWords(long[] data, long start, long number)
          throws a NonEmptyException exception
 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 int 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
Returns:
the number of words added to the buffer
See Also:
BitmapStorage.add(long)

addStreamOfEmptyWords

public int addStreamOfEmptyWords(boolean v,
                                 long number)
If the boolean value is true, 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
Returns:
the number of words added to the buffer
See Also:
BitmapStorage.addStreamOfEmptyWords(boolean, long)

addStreamOfDirtyWords

public long addStreamOfDirtyWords(long[] data,
                                  long start,
                                  long number)
throws a NonEmptyException exception

Specified by:
addStreamOfDirtyWords in interface BitmapStorage
Parameters:
data - the dirty words
start - the starting point in the array
number - the number of dirty words to add
Returns:
how many (compressed) words were added to the bitmap
See Also:
BitmapStorage.addStreamOfDirtyWords(long[], long, long)

addStreamOfNegatedDirtyWords

public long addStreamOfNegatedDirtyWords(long[] data,
                                         long start,
                                         long number)
throws a NonEmptyException exception

Specified by:
addStreamOfNegatedDirtyWords in interface BitmapStorage
Parameters:
data - the dirty words
start - the starting point in the array
number - the number of dirty words to add
Returns:
how many (compressed) words were added to the bitmap
See Also:
BitmapStorage.addStreamOfNegatedDirtyWords(long[], long, long)

setSizeInBits

public void setSizeInBits(int bits)
Does nothing.

Specified by:
setSizeInBits in interface BitmapStorage
Parameters:
bits - number of bits
See Also:
BitmapStorage.setSizeInBits(int)


Copyright © 2012. All Rights Reserved.