com.googlecode.javaewah32
Class BitCounter32

java.lang.Object
  extended by com.googlecode.javaewah32.BitCounter32
All Implemented Interfaces:
BitmapStorage32

public final class BitCounter32
extends Object
implements BitmapStorage32

BitCounter is a fake bitset data structure. Instead of storing the actual data, it only records the number of set bits.

Since:
0.5.0
Author:
Daniel Lemire and David McIntosh

Constructor Summary
BitCounter32()
           
 
Method Summary
 void addStreamOfEmptyWords(boolean v, int number)
          virtually add many zeroes or ones.
 void addStreamOfLiteralWords(int[] data, int start, int number)
          virtually add several literal words.
 void addStreamOfNegatedLiteralWords(int[] data, int start, int number)
          virtually add several negated literal words.
 void addWord(int newdata)
          Virtually add words directly to the bitmap
 int getCount()
          As you act on this class, it records the number of set (true) bits.
 void setSizeInBits(int bits)
          should directly set the sizeinbits field, but is effectively ignored in this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitCounter32

public BitCounter32()
Method Detail

addWord

public void addWord(int newdata)
Virtually add words directly to the bitmap

Specified by:
addWord in interface BitmapStorage32
Parameters:
newdata - the word

addStreamOfLiteralWords

public void addStreamOfLiteralWords(int[] data,
                                    int start,
                                    int number)
virtually add several literal words.

Specified by:
addStreamOfLiteralWords in interface BitmapStorage32
Parameters:
data - the literal words
start - the starting point in the array
number - the number of literal words to add

addStreamOfEmptyWords

public void addStreamOfEmptyWords(boolean v,
                                  int number)
virtually add many zeroes or ones.

Specified by:
addStreamOfEmptyWords in interface BitmapStorage32
Parameters:
v - zeros or ones
number - how many to words add

addStreamOfNegatedLiteralWords

public void addStreamOfNegatedLiteralWords(int[] data,
                                           int start,
                                           int number)
virtually add several negated literal words.

Specified by:
addStreamOfNegatedLiteralWords in interface BitmapStorage32
Parameters:
data - the literal words
start - the starting point in the array
number - the number of literal words to add

getCount

public int getCount()
As you act on this class, it records the number of set (true) bits.

Returns:
number of set bits

setSizeInBits

public void setSizeInBits(int bits)
should directly set the sizeinbits field, but is effectively ignored in this class.

Specified by:
setSizeInBits in interface BitmapStorage32
Parameters:
bits - number of bits


Copyright © 2014. All Rights Reserved.