public class IcedBitSet extends Iced
The bits are numbered starting at _offset - so there is an implicit offset built-in as a service; the offset can be zero. This allows for an efficient representation if there is a known zero prefix of bits.
The number of bits (after the zero offset) is also required - meaning this is a fixed-size (not-auto-sizing) bitset, and this bit offset is removed from all bit-indices.
A number of bytes in the byte[] can be skipped also; this is value skips bytes, not bit indices, and is intended to allow an IcedBitSet to be embedded inside a large byte array containing unrelated data.
Constructor and Description |
---|
IcedBitSet(int nbits) |
IcedBitSet(int nbits,
int bitoff) |
Modifier and Type | Method and Description |
---|---|
int |
cardinality() |
void |
clear(int idx) |
void |
compress2(AutoBuffer ab) |
void |
compress3(AutoBuffer ab) |
boolean |
contains(int idx) |
void |
fill(byte[] v,
int byteoff,
int nbits,
int bitoff) |
void |
fill2(byte[] bits,
AutoBuffer ab) |
void |
fill3(byte[] bits,
AutoBuffer ab) |
boolean |
isInRange(int idx) |
int |
max() |
int |
numBytes() |
void |
set(int idx)
Activate the bit specified by the integer (must be from 0 ...
|
int |
size() |
void |
toJava(SB sb,
java.lang.String varname,
int col) |
void |
toJavaRangeCheck(SB sb,
int col) |
java.lang.String |
toStrArray() |
java.lang.String |
toString() |
SB |
toString(SB sb) |
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public IcedBitSet(int nbits)
public IcedBitSet(int nbits, int bitoff)
public void fill(byte[] v, int byteoff, int nbits, int bitoff)
public boolean isInRange(int idx)
public boolean contains(int idx)
public void set(int idx)
idx
- -public void clear(int idx)
public int cardinality()
public int size()
public int numBytes()
public int max()
public void compress2(AutoBuffer ab)
public void fill2(byte[] bits, AutoBuffer ab)
public void compress3(AutoBuffer ab)
public void fill3(byte[] bits, AutoBuffer ab)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStrArray()
public void toJava(SB sb, java.lang.String varname, int col)
public void toJavaRangeCheck(SB sb, int col)