Top Description Fields Constructors Methods
com.googlecode.javaewah

public final Class IteratorAggregation

Additional top-level classes in compilation unit: BufferedORIterator, BufferedXORIterator, BufferedAndIterator.

extends Object
Class Inheritance
Imports
java.util.Arrays, .Collections, .Iterator, .LinkedList

Set of helper functions to aggregate bitmaps.

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_MAX_BUF_SIZE

An optimization option.

Constructor Summary

AccessConstructor and Description
private
IteratorAggregation()

Private constructor to prevent instantiation

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
andToContainer(final BitmapStorage container, int desiredrlwcount, final IteratingRLW rlwi, IteratingRLW rlwj)

pack-priv static void
andToContainer(final BitmapStorage container, final IteratingRLW rlwi, IteratingRLW rlwj)

public static IteratingRLW

Returns:

and aggregate
bufferedand
(final IteratingRLW...
set of iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

public static IteratingRLW

Returns:

and aggregate
bufferedand
(final int
size of the internal buffer used by the iterator in 64-bit words (per input iterator)
bufSize
,
final IteratingRLW...
set of iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

public static IteratingRLW

Returns:

or aggregate
bufferedor
(final IteratingRLW...
set of iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

public static IteratingRLW

Returns:

or aggregate
bufferedor
(final int
size of the internal buffer used by the iterator in 64-bit words
bufSize
,
final IteratingRLW...
iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

public static IteratingRLW

Returns:

xor aggregate
bufferedxor
(final IteratingRLW...
set of iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

public static IteratingRLW

Returns:

xor aggregate
bufferedxor
(final int
size of the internal buffer used by the iterator in 64-bit words
bufSize
,
final IteratingRLW...
iterators to aggregate
al
)

Aggregate the iterators using a bitmap buffer.

protected static long

Returns:

how many written
discharge
(final BitmapStorage
target for writes
container
,
IteratingRLW
source of data
i
,
long
maximal number of writes
max
)

Write out up to max words, returns how many were written

protected static void
dischargeAsEmpty(final BitmapStorage
where we write
container
,
final IteratingRLW
the iterator
i
)

Write out the content of the iterator, but as if it were all zeros.

protected static long

Returns:

how many written
dischargeNegated
(final BitmapStorage
target for writes
container
,
IteratingRLW
source of data
i
,
long
maximal number of writes
max
)

Write out up to max negated words, returns how many were written

protected static int
inplaceand(long[] bitmap, IteratingRLW i)

protected static int
inplaceor(long[] bitmap, IteratingRLW i)

protected static int
inplacexor(long[] bitmap, IteratingRLW i)

public static IteratingRLW

Returns:

negated version of the iterator
not
(final IteratingRLW
iterator to negate
x
)

public static void
xorToContainer(final BitmapStorage
where to write
container
,
int
number of words to be written (max)
desiredrlwcount
,
final IteratingRLW
first iterator to aggregate
rlwi
,
final IteratingRLW
second iterator to aggregate
rlwj
)

Compute the first few words of the XOR aggregate between two iterators.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_MAX_BUF_SIZEback to summary
public static final int DEFAULT_MAX_BUF_SIZE

An optimization option. Larger values may improve speed, but at the expense of memory.

Constructor Detail

IteratorAggregationback to summary
private IteratorAggregation()

Private constructor to prevent instantiation

Method Detail

andToContainerback to summary
pack-priv static void andToContainer(final BitmapStorage container, int desiredrlwcount, final IteratingRLW rlwi, IteratingRLW rlwj)
andToContainerback to summary
pack-priv static void andToContainer(final BitmapStorage container, final IteratingRLW rlwi, IteratingRLW rlwj)
bufferedandback to summary
public static IteratingRLW bufferedand(final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
al:IteratingRLW[]

set of iterators to aggregate

Returns:IteratingRLW

and aggregate

bufferedandback to summary
public static IteratingRLW bufferedand(final int bufSize, final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
bufSize:int

size of the internal buffer used by the iterator in 64-bit words (per input iterator)

al:IteratingRLW[]

set of iterators to aggregate

Returns:IteratingRLW

and aggregate

bufferedorback to summary
public static IteratingRLW bufferedor(final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
al:IteratingRLW[]

set of iterators to aggregate

Returns:IteratingRLW

or aggregate

bufferedorback to summary
public static IteratingRLW bufferedor(final int bufSize, final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
bufSize:int

size of the internal buffer used by the iterator in 64-bit words

al:IteratingRLW[]

iterators to aggregate

Returns:IteratingRLW

or aggregate

bufferedxorback to summary
public static IteratingRLW bufferedxor(final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
al:IteratingRLW[]

set of iterators to aggregate

Returns:IteratingRLW

xor aggregate

bufferedxorback to summary
public static IteratingRLW bufferedxor(final int bufSize, final IteratingRLW... al)

Aggregate the iterators using a bitmap buffer.

Parameters
bufSize:int

size of the internal buffer used by the iterator in 64-bit words

al:IteratingRLW[]

iterators to aggregate

Returns:IteratingRLW

xor aggregate

dischargeback to summary
protected static long discharge(final BitmapStorage container, IteratingRLW i, long max)

Write out up to max words, returns how many were written

Parameters
container:BitmapStorage

target for writes

i:IteratingRLW

source of data

max:long

maximal number of writes

Returns:long

how many written

dischargeAsEmptyback to summary
protected static void dischargeAsEmpty(final BitmapStorage container, final IteratingRLW i)

Write out the content of the iterator, but as if it were all zeros.

Parameters
container:BitmapStorage

where we write

i:IteratingRLW

the iterator

dischargeNegatedback to summary
protected static long dischargeNegated(final BitmapStorage container, IteratingRLW i, long max)

Write out up to max negated words, returns how many were written

Parameters
container:BitmapStorage

target for writes

i:IteratingRLW

source of data

max:long

maximal number of writes

Returns:long

how many written

inplaceandback to summary
protected static int inplaceand(long[] bitmap, IteratingRLW i)
inplaceorback to summary
protected static int inplaceor(long[] bitmap, IteratingRLW i)
inplacexorback to summary
protected static int inplacexor(long[] bitmap, IteratingRLW i)
notback to summary
public static IteratingRLW not(final IteratingRLW x)
Parameters
x:IteratingRLW

iterator to negate

Returns:IteratingRLW

negated version of the iterator

xorToContainerback to summary
public static void xorToContainer(final BitmapStorage container, int desiredrlwcount, final IteratingRLW rlwi, final IteratingRLW rlwj)

Compute the first few words of the XOR aggregate between two iterators.

Parameters
container:BitmapStorage

where to write

desiredrlwcount:int

number of words to be written (max)

rlwi:IteratingRLW

first iterator to aggregate

rlwj:IteratingRLW

second iterator to aggregate