|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.roaringbitmap.RoaringBitmap
public final class RoaringBitmap
RoaringBitmap, a compressed alternative to the BitSet.
Field Summary | |
---|---|
protected RoaringArray |
highlowcontainer
|
Constructor Summary | |
---|---|
RoaringBitmap()
Create an empty bitmap |
Method Summary | |
---|---|
void |
add(int x)
set the value to "true", whether it already appears or not. |
void |
and(RoaringBitmap x2)
In-place bitwise AND (intersection) operation. |
static RoaringBitmap |
and(RoaringBitmap x1,
RoaringBitmap x2)
Bitwise AND (intersection) operation. |
void |
andNot(RoaringBitmap x2)
In-place bitwise ANDNOT (difference) operation. |
static RoaringBitmap |
andNot(RoaringBitmap x1,
RoaringBitmap x2)
Bitwise ANDNOT (difference) operation. |
static RoaringBitmap |
bitmapOf(int... dat)
Generate a bitmap with the specified values set to true. |
void |
clear()
reset to an empty bitmap; result occupies as much space a newly created bitmap. |
RoaringBitmap |
clone()
|
boolean |
contains(int x)
Checks whether the value in included, which is equivalent to checking if the corresponding bit is set (get in BitSet class). |
void |
deserialize(DataInput in)
Deserialize (retrieve) this bitmap. |
boolean |
equals(Object o)
|
void |
flip(int rangeStart,
int rangeEnd)
Modifies the current bitmap by complementing the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive). |
static RoaringBitmap |
flip(RoaringBitmap bm,
int rangeStart,
int rangeEnd)
Complements the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive). |
int |
getCardinality()
Returns the number of distinct integers added to the bitmap (e.g., number of bits set). |
int |
getSizeInBytes()
Estimate of the memory usage of this data structure. |
int |
hashCode()
|
Iterator<Integer> |
iterator()
iterate over the positions of the true values. |
void |
or(RoaringBitmap x2)
In-place bitwise OR (union) operation. |
static RoaringBitmap |
or(RoaringBitmap x1,
RoaringBitmap x2)
Bitwise OR (union) operation. |
void |
readExternal(ObjectInput in)
|
void |
remove(int x)
If present remove the specified integers (effectively, sets its bit value to false) |
void |
serialize(DataOutput out)
Serialize this bitmap. |
int |
serializedSizeInBytes()
Report the number of bytes required to serialize this bitmap. |
int[] |
toArray()
Return the set values as an array. |
String |
toString()
A string describing the bitmap. |
void |
trim()
Recover allocated but unused memory. |
void |
writeExternal(ObjectOutput out)
|
void |
xor(RoaringBitmap x2)
In-place bitwise XOR (symmetric difference) operation. |
static RoaringBitmap |
xor(RoaringBitmap x1,
RoaringBitmap x2)
Bitwise XOR (symmetric difference) operation. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected RoaringArray highlowcontainer
Constructor Detail |
---|
public RoaringBitmap()
Method Detail |
---|
public static RoaringBitmap and(RoaringBitmap x1, RoaringBitmap x2)
x1
- first bitmapx2
- other bitmap
public static RoaringBitmap andNot(RoaringBitmap x1, RoaringBitmap x2)
x1
- first bitmapx2
- other bitmap
public static RoaringBitmap bitmapOf(int... dat)
dat
- set values
public static RoaringBitmap flip(RoaringBitmap bm, int rangeStart, int rangeEnd)
bm
- bitmap being negatedrangeStart
- inclusive beginning of rangerangeEnd
- exclusive ending of range
public static RoaringBitmap or(RoaringBitmap x1, RoaringBitmap x2)
x1
- first bitmapx2
- other bitmap
public static RoaringBitmap xor(RoaringBitmap x1, RoaringBitmap x2)
x1
- first bitmapx2
- other bitmap
public void add(int x)
x
- integer valuepublic void and(RoaringBitmap x2)
x2
- other bitmappublic void andNot(RoaringBitmap x2)
x2
- other bitmappublic void clear()
public RoaringBitmap clone()
clone
in class Object
public boolean contains(int x)
x
- integer value
public void deserialize(DataInput in) throws IOException
in
- the DataInput stream
IOException
- Signals that an I/O exception has occurred.public boolean equals(Object o)
equals
in class Object
public void flip(int rangeStart, int rangeEnd)
rangeStart
- inclusive beginning of rangerangeEnd
- exclusive ending of rangepublic int getCardinality()
public int getSizeInBytes()
public int hashCode()
hashCode
in class Object
public Iterator<Integer> iterator()
iterator
in interface Iterable<Integer>
public void or(RoaringBitmap x2)
x2
- other bitmappublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void remove(int x)
x
- integer value representing the index in a bitmappublic void serialize(DataOutput out) throws IOException
out
- the DataOutput stream
IOException
- Signals that an I/O exception has occurred.public int serializedSizeInBytes()
public int[] toArray()
public String toString()
toString
in class Object
public void trim()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void xor(RoaringBitmap x2)
x2
- other bitmap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |