Top Description Fields Constructors Methods
com.googlecode.javaewah

public final Class BitCounter

extends Object
implements BitmapStorage
Class Inheritance
All Implemented Interfaces
com.googlecode.javaewah.BitmapStorage

BitCounter is a fake bitset data structure. Instead of storing the actual data, it only records the number of set bits.
Author
David McIntosh
Since
0.4.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 long
the word
newData
)

Implements com.googlecode.javaewah.BitmapStorage.addLiteralWord.

Virtually add literal words directly to the bitmap

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

Implements com.googlecode.javaewah.BitmapStorage.addStreamOfEmptyWords.

virtually add many zeroes or ones.

public void
addStreamOfLiteralWords(final Buffer
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.javaewah.BitmapStorage.addStreamOfLiteralWords.

virtually add several literal words.

public void
addStreamOfNegatedLiteralWords(final Buffer
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.javaewah.BitmapStorage.addStreamOfNegatedLiteralWords.

virtually add several negated literal words.

public void
addWord(final long
the word
newData
)

Implements com.googlecode.javaewah.BitmapStorage.addWord.

Virtually add words directly to the bitmap

public void
clear()

Implements com.googlecode.javaewah.BitmapStorage.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
number of bits
bits
)

Implements com.googlecode.javaewah.BitmapStorage.setSizeInBitsWithinLastWord.

should directly set the sizeInBits field, but is effectively ignored in this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

oneBitsback to summary
private int oneBits

Constructor Detail

BitCounterback to summary
public BitCounter()

Method Detail

addLiteralWordback to summary
public void addLiteralWord(final long newData)

Implements com.googlecode.javaewah.BitmapStorage.addLiteralWord.

Virtually add literal words directly to the bitmap

Parameters
newData:long

the word

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

Implements com.googlecode.javaewah.BitmapStorage.addStreamOfEmptyWords.

virtually add many zeroes or ones.

Parameters
v:boolean

zeros or ones

number:long

how many to words add

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

Implements com.googlecode.javaewah.BitmapStorage.addStreamOfLiteralWords.

virtually add several literal words.

Parameters
buffer:Buffer

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(final Buffer buffer, int start, int number)

Implements com.googlecode.javaewah.BitmapStorage.addStreamOfNegatedLiteralWords.

virtually add several negated literal words.

Parameters
buffer:Buffer

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 long newData)

Implements com.googlecode.javaewah.BitmapStorage.addWord.

Virtually add words directly to the bitmap

Parameters
newData:long

the word

Annotations
@Override
clearback to summary
public void clear()

Implements com.googlecode.javaewah.BitmapStorage.clear.

Doc from com.googlecode.javaewah.BitmapStorage.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.javaewah.BitmapStorage.setSizeInBitsWithinLastWord.

should directly set the sizeInBits field, but is effectively ignored in this class.

Parameters
bits:int

number of bits

Annotations
@Override