Top Description Fields Constructors Methods
com.googlecode.javaewah32

public final Class BitCounter32

extends Object
implements BitmapStorage32
Class Inheritance
All Implemented Interfaces
com.googlecode.javaewah32.BitmapStorage32

BitCounter is a fake bitset data structure. Instead of storing the actual data, it only records the number of set bits.
Author
Daniel Lemire and David McIntosh
Since
0.5.0

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addLiteralWord(final int
the word
newData
)

Implements com.googlecode.javaewah32.BitmapStorage32.addLiteralWord.

Virtually add literal words directly to the bitmap

public void
addStreamOfEmptyWords(boolean
zeros or ones
v
,
int
how many to words add
number
)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfEmptyWords.

virtually add many zeroes or ones.

public void
addStreamOfLiteralWords(Buffer32
the buffer wrapping the literal words
buffer
,
int
the starting point in the array
start
,
int
the number of literal words to add
number
)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfLiteralWords.

virtually add several literal words.

public void
addStreamOfNegatedLiteralWords(Buffer32
the buffer wrapping the literal words
buffer
,
int
the starting point in the array
start
,
int
the number of literal words to add
number
)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfNegatedLiteralWords.

virtually add several negated literal words.

public void
addWord(final int
the word
newData
)

Implements com.googlecode.javaewah32.BitmapStorage32.addWord.

Virtually add words directly to the bitmap

public void
clear()

Implements com.googlecode.javaewah32.BitmapStorage32.clear.

Empties the container.

public int

Returns:

number of set bits
getCount
()

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

public void
setSizeInBitsWithinLastWord(int
the size in bits
bits
)

Implements com.googlecode.javaewah32.BitmapStorage32.setSizeInBitsWithinLastWord.

Sets the size in bits of the bitmap as an *uncompressed* bitmap.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

oneBitsback to summary
private int oneBits

Constructor Detail

BitCounter32back to summary
public BitCounter32()

Method Detail

addLiteralWordback to summary
public void addLiteralWord(final int newData)

Implements com.googlecode.javaewah32.BitmapStorage32.addLiteralWord.

Virtually add literal words directly to the bitmap

Parameters
newData:int

the word

Annotations
@Override
addStreamOfEmptyWordsback to summary
public void addStreamOfEmptyWords(boolean v, int number)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfEmptyWords.

virtually add many zeroes or ones.

Parameters
v:boolean

zeros or ones

number:int

how many to words add

Annotations
@Override
addStreamOfLiteralWordsback to summary
public void addStreamOfLiteralWords(Buffer32 buffer, int start, int number)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfLiteralWords.

virtually add several literal words.

Parameters
buffer:Buffer32

the buffer wrapping the literal words

start:int

the starting point in the array

number:int

the number of literal words to add

Annotations
@Override
addStreamOfNegatedLiteralWordsback to summary
public void addStreamOfNegatedLiteralWords(Buffer32 buffer, int start, int number)

Implements com.googlecode.javaewah32.BitmapStorage32.addStreamOfNegatedLiteralWords.

virtually add several negated literal words.

Parameters
buffer:Buffer32

the buffer wrapping the literal words

start:int

the starting point in the array

number:int

the number of literal words to add

Annotations
@Override
addWordback to summary
public void addWord(final int newData)

Implements com.googlecode.javaewah32.BitmapStorage32.addWord.

Virtually add words directly to the bitmap

Parameters
newData:int

the word

Annotations
@Override
clearback to summary
public void clear()

Implements com.googlecode.javaewah32.BitmapStorage32.clear.

Doc from com.googlecode.javaewah32.BitmapStorage32.clear.

Empties the container.

Annotations
@Override
getCountback to summary
public int getCount()

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

Returns:int

number of set bits

setSizeInBitsWithinLastWordback to summary
public void setSizeInBitsWithinLastWord(int bits)

Implements com.googlecode.javaewah32.BitmapStorage32.setSizeInBitsWithinLastWord.

Doc from com.googlecode.javaewah32.BitmapStorage32.setSizeInBitsWithinLastWord.

Sets the size in bits of the bitmap as an *uncompressed* bitmap. Normally, this is used to reduce the size of the bitmaps within the scope of the last word. Specifically, this means that (sizeInBits()+31)/32 must be equal to (size+31)/32. If needed, the bitmap can be further padded with zeroes.

Parameters
bits:int

the size in bits

Annotations
@Override