Top Description Constructors Methods
com.googlecode.javaewah

public final Class IteratorUtil

extends Object
Class Inheritance
Imports
java.util.Iterator

Convenience functions for working over iterators

Constructor Summary

AccessConstructor and Description
private
IteratorUtil()

Private constructor to prevent instantiation

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the cardinality (number of set bits) corresponding to the iterator
cardinality
(final IteratingRLW
iterator we wish to iterate over
i
)

public static void
materialize(final IteratingRLW
iterator we wish to materialize
i
,
final BitmapStorage
where we write
c
)

Generate a bitmap from an iterator.

public static long

Returns:

how many words were actually materialized
materialize
(final IteratingRLW
iterator we wish to materialize
i
,
final BitmapStorage
where we write
c
,
long
maximum number of words we wish to materialize
max
)

Turn an iterator into a bitmap.

public static EWAHCompressedBitmap

Returns:

materialized version of the iterator
materialize
(final IteratingRLW
iterator we wish to materialize
i
)

Turn an iterator into a bitmap.

public static IteratingRLW[]

Returns:

an array of iterators corresponding to the array of bitmaps
toIterators
(final EWAHCompressedBitmap...
set of bitmaps
x
)

public static IntIterator

Returns:

an iterator over the set bits corresponding to the iterator
toSetBitsIntIterator
(final IteratingRLW
iterator we wish to iterate over
i
)

public static Iterator<Integer>

Returns:

an iterator over the set bits corresponding to the iterator
toSetBitsIterator
(final IteratingRLW
iterator we wish to iterate over
i
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IteratorUtilback to summary
private IteratorUtil()

Private constructor to prevent instantiation

Method Detail

cardinalityback to summary
public static int cardinality(final IteratingRLW i)
Parameters
i:IteratingRLW

iterator we wish to iterate over

Returns:int

the cardinality (number of set bits) corresponding to the iterator

materializeback to summary
public static void materialize(final IteratingRLW i, final BitmapStorage c)

Generate a bitmap from an iterator.

Parameters
i:IteratingRLW

iterator we wish to materialize

c:BitmapStorage

where we write

materializeback to summary
public static long materialize(final IteratingRLW i, final BitmapStorage c, long max)

Turn an iterator into a bitmap.

Parameters
i:IteratingRLW

iterator we wish to materialize

c:BitmapStorage

where we write

max:long

maximum number of words we wish to materialize

Returns:long

how many words were actually materialized

materializeback to summary
public static EWAHCompressedBitmap materialize(final IteratingRLW i)

Turn an iterator into a bitmap. This can be used to effectively clone a bitmap in the following manner: EWAHCompressedBitmap n = IteratorUtil.materialize(bitmap.getIteratingRLW())); n.setSizeInBitsWithinLastWord(bitmap.sizeInBits());

Parameters
i:IteratingRLW

iterator we wish to materialize

Returns:EWAHCompressedBitmap

materialized version of the iterator

toIteratorsback to summary
public static IteratingRLW[] toIterators(final EWAHCompressedBitmap... x)
Parameters
x:EWAHCompressedBitmap[]

set of bitmaps

Returns:IteratingRLW[]

an array of iterators corresponding to the array of bitmaps

toSetBitsIntIteratorback to summary
public static IntIterator toSetBitsIntIterator(final IteratingRLW i)
Parameters
i:IteratingRLW

iterator we wish to iterate over

Returns:IntIterator

an iterator over the set bits corresponding to the iterator

toSetBitsIteratorback to summary
public static Iterator<Integer> toSetBitsIterator(final IteratingRLW i)
Parameters
i:IteratingRLW

iterator we wish to iterate over

Returns:Iterator<Integer>

an iterator over the set bits corresponding to the iterator