it.unimi.dsi.sux4j.bits
Interface SelectZero

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
RankSelect, SimpleSelectZero

public interface SelectZero
extends java.io.Serializable

A data structure providing zero selection over a bit array.

This interface has essentially the same specification as that of Select, but the method selectZero(long) selects zeroes instead of ones. Ranking zeroes is trivial (and trivially implemented in AbstractRank), but selecting zeroes requires specific data structures.

See Also:
Select

Method Summary
 BitVector bitVector()
          Returns the bit vector indexed by this structure.
 long numBits()
          Returns the overall number of bits allocated by this structure.
 long selectZero(long rank)
          Returns the position of the bit of given rank.
 

Method Detail

selectZero

long selectZero(long rank)
Returns the position of the bit of given rank. Equivalently, returns the greatest position that is preceded by the specified number of ones.

Parameters:
rank - a rank.
Returns:
the position of the bit of given rank; if no such position exists, −1 is returned.

bitVector

BitVector bitVector()
Returns the bit vector indexed by this structure.

Note that you are not supposed to modify the returned vector.

Returns:
the bit vector indexed by this structure.

numBits

long numBits()
Returns the overall number of bits allocated by this structure.

Returns:
the overall number of bits allocated by this structure (not including the bits of the indexed vector).