public class MutableRoaringBitmap extends ImmutableRoaringBitmap implements Cloneable, Serializable, Iterable<Integer>, Externalizable
import org.roaringbitmap.buffer.*;
//...
MutableRoaringBitmap rr = MutableRoaringBitmap.bitmapOf(1,2,3,1000);
MutableRoaringBitmap rr2 = new MutableRoaringBitmap();
for(int k = 4000; k<4255;++k) rr2.add(k);
RoaringBitmap rror = RoaringBitmap.or(rr, rr2);
| Constructor and Description |
|---|
MutableRoaringBitmap()
Create an empty bitmap
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int x)
set the value to "true", whether it already appears or not.
|
void |
and(ImmutableRoaringBitmap array)
In-place bitwise AND (intersection) operation.
|
static MutableRoaringBitmap |
and(MutableRoaringBitmap x1,
MutableRoaringBitmap x2)
Bitwise AND (intersection) operation.
|
void |
andNot(ImmutableRoaringBitmap x2)
In-place bitwise ANDNOT (difference) operation.
|
static MutableRoaringBitmap |
andNot(MutableRoaringBitmap x1,
MutableRoaringBitmap x2)
Bitwise ANDNOT (difference) operation.
|
static MutableRoaringBitmap |
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.
|
MutableRoaringBitmap |
clone() |
void |
deserialize(DataInput in)
Deserialize the bitmap (retrieve from the input stream).
|
void |
flip(int rangeStart,
int rangeEnd)
Modifies the current bitmap by complementing the bits in the given range,
from rangeStart (inclusive) rangeEnd (exclusive).
|
static MutableRoaringBitmap |
flip(MutableRoaringBitmap bm,
int rangeStart,
int rangeEnd)
Complements the bits in the given range, from rangeStart (inclusive)
rangeEnd (exclusive).
|
MutableRoaringArray |
getMappeableRoaringArray() |
int |
hashCode() |
Iterator<Integer> |
iterator()
iterate over the positions of the true values.
|
void |
or(ImmutableRoaringBitmap x2)
In-place bitwise OR (union) operation.
|
static MutableRoaringBitmap |
or(MutableRoaringBitmap x1,
MutableRoaringBitmap 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)
|
String |
toString()
A string describing the bitmap.
|
void |
trim()
Recover allocated but unused memory.
|
void |
writeExternal(ObjectOutput out) |
void |
xor(ImmutableRoaringBitmap x2)
In-place bitwise XOR (symmetric difference) operation.
|
static MutableRoaringBitmap |
xor(MutableRoaringBitmap x1,
MutableRoaringBitmap x2)
Bitwise XOR (symmetric difference) operation.
|
and, andNot, contains, equals, flip, getCardinality, getIntIterator, getSizeInBytes, isEmpty, limit, or, rank, select, serialize, serializedSizeInBytes, toArray, toMutableRoaringBitmap, xorfinalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static MutableRoaringBitmap and(MutableRoaringBitmap x1, MutableRoaringBitmap x2)
x1 - first bitmapx2 - other bitmappublic static MutableRoaringBitmap andNot(MutableRoaringBitmap x1, MutableRoaringBitmap x2)
x1 - first bitmapx2 - other bitmappublic static MutableRoaringBitmap bitmapOf(int... dat)
dat - set valuespublic static MutableRoaringBitmap flip(MutableRoaringBitmap bm, int rangeStart, int rangeEnd)
bm - bitmap being negatedrangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic static MutableRoaringBitmap or(MutableRoaringBitmap x1, MutableRoaringBitmap x2)
x1 - first bitmapx2 - other bitmappublic static MutableRoaringBitmap xor(MutableRoaringBitmap x1, MutableRoaringBitmap x2)
x1 - first bitmapx2 - other bitmappublic void add(int x)
x - integer valuepublic void and(ImmutableRoaringBitmap array)
array - other bitmappublic void andNot(ImmutableRoaringBitmap x2)
x2 - other bitmappublic void clear()
public MutableRoaringBitmap clone()
clone in class ImmutableRoaringBitmappublic void deserialize(DataInput in) throws IOException
in - the DataInput streamIOException - Signals that an I/O exception has occurred.public void flip(int rangeStart,
int rangeEnd)
rangeStart - inclusive beginning of rangerangeEnd - exclusive ending of rangepublic MutableRoaringArray getMappeableRoaringArray()
public int hashCode()
hashCode in class ImmutableRoaringBitmappublic Iterator<Integer> iterator()
iterator in interface Iterable<Integer>iterator in class ImmutableRoaringBitmappublic void or(ImmutableRoaringBitmap x2)
x2 - other bitmappublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic void remove(int x)
x - integer value representing the index in a bitmappublic String toString()
toString in class ImmutableRoaringBitmappublic void trim()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void xor(ImmutableRoaringBitmap x2)
x2 - other bitmapCopyright © 2014. All Rights Reserved.