|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unimi.dsi.bits.BitVectors
public class BitVectors
A class providing static methods and objects that do useful things with bit vectors.
BitVector
Field Summary | |
---|---|
static BitVector |
EMPTY_VECTOR
An immutable, singleton empty bit vector. |
static it.unimi.dsi.bits.BitVectors.BitVectorOfflineSerializer |
OFFLINE_SERIALIZER
A serializer for LongArrayBitVector instances that can be used with OfflineIterable . |
static BitVector |
ONE
An immutable bit vector of length one containing a one. |
static BitVector |
ZERO
An immutable bit vector of length one containing a zero. |
Method Summary | ||
---|---|---|
static void |
ensureFromTo(long bitVectorLength,
long from,
long to)
|
|
static
|
identity()
Deprecated. |
|
static LongArrayBitVector |
readFast(DataInput dis)
Reads quickly a bit vector from a DataInputStream . |
|
static LongArrayBitVector |
readFast(DataInput dis,
LongArrayBitVector bv)
Reads quickly a bit vector from a DataInputStream . |
|
static void |
writeFast(BitVector v,
DataOutput dos)
Writes quickly a bit vector to a DataOutputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BitVector EMPTY_VECTOR
public static final BitVector ZERO
public static final BitVector ONE
public static it.unimi.dsi.bits.BitVectors.BitVectorOfflineSerializer OFFLINE_SERIALIZER
LongArrayBitVector
instances that can be used with OfflineIterable
. It can serialize
any implementation of BitVector
, and requires at construction time an instance of LongArrayBitVector
that
will be used to return deserialized elements.
Method Detail |
---|
@Deprecated public static <T extends BitVector> TransformationStrategy<T> identity()
public static void ensureFromTo(long bitVectorLength, long from, long to)
public static void writeFast(BitVector v, DataOutput dos) throws IOException
DataOutputStream
.
This method writes a bit vector in a simple format: first, a long representing the length.
Then, as many longs as necessary to write the bits in the bit vectors (i.e.,
LongArrayBitVector.numWords(long)
of the bit vector length), obtained via BitVector.getLong(long, long)
.
The main purpose of this function is to support OfflineIterable
(see OFFLINE_SERIALIZER
).
v
- a bit vector.dos
- a data output stream.
IOException
public static LongArrayBitVector readFast(DataInput dis) throws IOException
DataInputStream
.
This method is the dual of writeFast(BitVector, DataOutput)
. If you
need to avoid creating a bit vector at each call, please have a look at readFast(DataInput, LongArrayBitVector)
.
dis
- a data input stream.
writeFast(BitVector, DataOutput)
.
IOException
writeFast(BitVector, DataOutput)
,
readFast(DataInput, LongArrayBitVector)
public static LongArrayBitVector readFast(DataInput dis, LongArrayBitVector bv) throws IOException
DataInputStream
.
This method is similar in purpose to readFast(DataInput)
, but it allows reuse of the bit vector.
dis
- a data input stream.bv
- a long-array bit vector.
bv
, filled with the next bit vector in the stream, as saved by writeFast(BitVector, DataOutput)
.
IOException
writeFast(BitVector, DataOutput)
,
readFast(DataInput)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |