javaewah32
Class NonEmptyVirtualStorage32

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

Constructor Summary
NonEmptyVirtualStorage32()
           
 
Method Summary
 void add(int newdata)
          If the word to be added is non-zero, a NonEmptyException exception is thrown.
 void addStreamOfDirtyWords(int[] data, int start, int number)
          throws a NonEmptyException exception when number > 0
 void addStreamOfEmptyWords(boolean v, int number)
          If the boolean value is true, then it throws a NonEmptyException exception, otherwise, nothing happens.
 void addStreamOfNegatedDirtyWords(int[] data, int start, int number)
          throws a NonEmptyException exception when number > 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

NonEmptyVirtualStorage32

public NonEmptyVirtualStorage32()
Method Detail

add

public void add(int newdata)
If the word to be added is non-zero, a NonEmptyException exception is thrown.

Specified by:
add in interface BitmapStorage32
Parameters:
newdata - the word
See Also:
javaewah.BitmapStorage#add(int)

addStreamOfEmptyWords

public void addStreamOfEmptyWords(boolean v,
                                  int number)
If the boolean value is true, 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
See Also:
javaewah.BitmapStorage#addStreamOfEmptyWords(boolean, int)

addStreamOfDirtyWords

public void addStreamOfDirtyWords(int[] data,
                                  int start,
                                  int number)
throws a NonEmptyException exception when number > 0

Specified by:
addStreamOfDirtyWords in interface BitmapStorage32
Parameters:
data - the dirty words
start - the starting point in the array
number - the number of dirty words to add
See Also:
javaewah.BitmapStorage#addStreamOfDirtyWords(int[], int, int)

addStreamOfNegatedDirtyWords

public void addStreamOfNegatedDirtyWords(int[] data,
                                         int start,
                                         int number)
throws a NonEmptyException exception when number > 0

Specified by:
addStreamOfNegatedDirtyWords in interface BitmapStorage32
Parameters:
data - the dirty words
start - the starting point in the array
number - the number of dirty words to add
See Also:
javaewah.BitmapStorage#addStreamOfNegatedDirtyWords(int[], int, int)

setSizeInBits

public void setSizeInBits(int bits)
Does nothing.

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


Copyright © 2012. All Rights Reserved.