com.googlecode.javaewah
Class IteratorAggregation

java.lang.Object
  extended by com.googlecode.javaewah.IteratorAggregation

public class IteratorAggregation
extends Object

Set of helper functions to aggregate bitmaps.


Field Summary
static int DEFAULTMAXBUFSIZE
          An optimization option.
 
Constructor Summary
IteratorAggregation()
           
 
Method Summary
static IteratingRLW bufferedand(int bufsize, IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
static IteratingRLW bufferedand(IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
static IteratingRLW bufferedor(int bufsize, IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
static IteratingRLW bufferedor(IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
static IteratingRLW bufferedxor(int bufsize, IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
static IteratingRLW bufferedxor(IteratingRLW... al)
          Aggregate the iterators using a bitmap buffer.
protected static long discharge(BitmapStorage container, IteratingRLW i, long max)
          Write out up to max words, returns how many were written
protected static void dischargeAsEmpty(BitmapStorage container, IteratingRLW i)
          Write out the content of the iterator, but as if it were all zeros.
protected static long dischargeNegated(BitmapStorage container, IteratingRLW i, long 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)
           
static IteratingRLW not(IteratingRLW x)
           
static void xorToContainer(BitmapStorage container, int desiredrlwcount, IteratingRLW rlwi, IteratingRLW rlwj)
          Compute the first few words of the XOR aggregate between two iterators.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULTMAXBUFSIZE

public static final int DEFAULTMAXBUFSIZE
An optimization option. Larger values may improve speed, but at the expense of memory.

See Also:
Constant Field Values
Constructor Detail

IteratorAggregation

public IteratorAggregation()
Method Detail

not

public static IteratingRLW not(IteratingRLW x)
Parameters:
x - iterator to negate
Returns:
negated version of the iterator

bufferedand

public static IteratingRLW bufferedand(IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - set of iterators to aggregate
Returns:
and aggregate

bufferedand

public static IteratingRLW bufferedand(int bufsize,
                                       IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - set of iterators to aggregate
bufsize - size of the internal buffer used by the iterator in 64-bit words (per input iterator)
Returns:
and aggregate

bufferedor

public static IteratingRLW bufferedor(IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - set of iterators to aggregate
Returns:
or aggregate

bufferedor

public static IteratingRLW bufferedor(int bufsize,
                                      IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - iterators to aggregate
bufsize - size of the internal buffer used by the iterator in 64-bit words
Returns:
or aggregate

bufferedxor

public static IteratingRLW bufferedxor(IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - set of iterators to aggregate
Returns:
xor aggregate

bufferedxor

public static IteratingRLW bufferedxor(int bufsize,
                                       IteratingRLW... al)
Aggregate the iterators using a bitmap buffer.

Parameters:
al - iterators to aggregate
bufsize - size of the internal buffer used by the iterator in 64-bit words
Returns:
xor aggregate

dischargeAsEmpty

protected static void dischargeAsEmpty(BitmapStorage container,
                                       IteratingRLW i)
Write out the content of the iterator, but as if it were all zeros.

Parameters:
container - where we write
i - the iterator

discharge

protected static long discharge(BitmapStorage container,
                                IteratingRLW i,
                                long max)
Write out up to max words, returns how many were written

Parameters:
container - target for writes
i - source of data
max - maximal number of writes
Returns:
how many written

dischargeNegated

protected static long dischargeNegated(BitmapStorage container,
                                       IteratingRLW i,
                                       long max)
Write out up to max negated words, returns how many were written

Parameters:
container - target for writes
i - source of data
max - maximal number of writes
Returns:
how many written

xorToContainer

public static void xorToContainer(BitmapStorage container,
                                  int desiredrlwcount,
                                  IteratingRLW rlwi,
                                  IteratingRLW rlwj)
Compute the first few words of the XOR aggregate between two iterators.

Parameters:
container - where to write
desiredrlwcount - number of words to be written (max)
rlwi - first iterator to aggregate
rlwj - second iterator to aggregate

inplaceor

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

inplacexor

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

inplaceand

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


Copyright © 2014. All Rights Reserved.