com.googlecode.javaewah
Class IteratorUtil

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

public class IteratorUtil
extends Object

Convenience functions for working over iterators


Constructor Summary
IteratorUtil()
           
 
Method Summary
static int cardinality(IteratingRLW i)
           
static EWAHCompressedBitmap materialize(IteratingRLW i)
          Turn an iterator into a bitmap
static void materialize(IteratingRLW i, BitmapStorage c)
          Generate a bitmap from an iterator
static long materialize(IteratingRLW i, BitmapStorage c, long Max)
          Turn an iterator into a bitmap.
static IteratingRLW[] toIterators(EWAHCompressedBitmap... x)
           
static IntIterator toSetBitsIntIterator(IteratingRLW i)
           
static Iterator<Integer> toSetBitsIterator(IteratingRLW i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorUtil

public IteratorUtil()
Method Detail

toSetBitsIntIterator

public static IntIterator toSetBitsIntIterator(IteratingRLW i)
Parameters:
i - iterator we wish to iterate over
Returns:
an iterator over the set bits corresponding to the iterator

toSetBitsIterator

public static Iterator<Integer> toSetBitsIterator(IteratingRLW i)
Parameters:
i - iterator we wish to iterate over
Returns:
an iterator over the set bits corresponding to the iterator

materialize

public static void materialize(IteratingRLW i,
                               BitmapStorage c)
Generate a bitmap from an iterator

Parameters:
i - iterator we wish to materialize
c - where we write

cardinality

public static int cardinality(IteratingRLW i)
Parameters:
i - iterator we wish to iterate over
Returns:
the cardinality (number of set bits) corresponding to the iterator

toIterators

public static IteratingRLW[] toIterators(EWAHCompressedBitmap... x)
Parameters:
x - set of bitmaps
Returns:
an array of iterators corresponding to the array of bitmaps

materialize

public static long materialize(IteratingRLW i,
                               BitmapStorage c,
                               long Max)
Turn an iterator into a bitmap.

Parameters:
i - iterator we wish to materialize
c - where we write
Max - maximum number of words we wish to materialize
Returns:
how many words were actually materialized

materialize

public static EWAHCompressedBitmap materialize(IteratingRLW i)
Turn an iterator into a bitmap

Parameters:
i - iterator we wish to materialize
Returns:
materialized version of the iterator


Copyright © 2014. All Rights Reserved.