Top Description Constructors Methods
com.googlecode.javaewah32

public final Class IteratorUtil32

extends Object
Class Inheritance
Imports
com.googlecode.javaewah.IntIterator, java.util.Iterator

Convenience functions for working over iterators

Constructor Summary

AccessConstructor and Description
private
IteratorUtil32()

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 IteratingRLW32
iterator we wish to iterate over
i
)

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

Turn an iterator into a bitmap

public static long

Returns:

how many words were actually materialized
materialize
(final IteratingRLW32
iterator we wish to materialize
i
,
final BitmapStorage32
where we write
c
,
int
maximum number of words to materialize
max
)

Turn an iterator into a bitmap

public static EWAHCompressedBitmap32

Returns:

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

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

public static IteratingRLW32[]

Returns:

an array of iterators corresponding to the array of bitmaps
toIterators
(final EWAHCompressedBitmap32...
set of bitmaps we wish to iterate over
x
)

public static IntIterator

Returns:

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

public static Iterator<Integer>

Returns:

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IteratorUtil32back to summary
private IteratorUtil32()

Private constructor to prevent instantiation

Method Detail

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

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 IteratingRLW32 i, final BitmapStorage32 c)

Turn an iterator into a bitmap

Parameters
i:IteratingRLW32

iterator we wish to materialize

c:BitmapStorage32

where we write

materializeback to summary
public static long materialize(final IteratingRLW32 i, final BitmapStorage32 c, int max)

Turn an iterator into a bitmap

Parameters
i:IteratingRLW32

iterator we wish to materialize

c:BitmapStorage32

where we write

max:int

maximum number of words to materialize

Returns:long

how many words were actually materialized

materializeback to summary
public static EWAHCompressedBitmap32 materialize(final IteratingRLW32 i)

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

Parameters
i:IteratingRLW32

iterator we wish to materialize

Returns:EWAHCompressedBitmap32

materialized version of the iterator

toIteratorsback to summary
public static IteratingRLW32[] toIterators(final EWAHCompressedBitmap32... x)
Parameters
x:EWAHCompressedBitmap32[]

set of bitmaps we wish to iterate over

Returns:IteratingRLW32[]

an array of iterators corresponding to the array of bitmaps

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

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 IteratingRLW32 i)
Parameters
i:IteratingRLW32

iterator we wish to iterate over

Returns:Iterator<Integer>

an iterator over the set bits corresponding to the iterator