java.lang.Object
org.roaringbitmap.buffer.ImmutableRoaringBitmap
org.roaringbitmap.buffer.MutableRoaringBitmap
org.roaringbitmap.buffer.CopyOnWriteRoaringBitmap
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Iterable<Integer>,AppendableStorage<MappeableContainer>,BitmapDataProvider,ImmutableBitmapDataProvider
A MutableRoaringBitmap that implements copy-on-write semantics for containers.
This allows efficient sharing of memory-mapped containers until they need to be modified.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.roaringbitmap.ImmutableBitmapDataProvider
ImmutableBitmapDataProvider.RoaringOfInt -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int x) Add the value to the container (set the value to "true"), whether it already appears or not.voidIn-place bitwise AND (intersection) operation.voidIn-place bitwise ANDNOT (difference) operation.clone()voidflip(int x) Add the value if it is not already present, otherwise remove it.static CopyOnWriteRoaringBitmapfromImmutable(ImmutableRoaringBitmap immutable) Create a copy-on-write bitmap from an immutable bitmap.voidIn-place bitwise OR (union) operation.voidremove(int x) If present remove the specified integers (effectively, sets its bit value to false)voidIn-place bitwise XOR (symmetric difference) operation.Methods inherited from class org.roaringbitmap.buffer.MutableRoaringBitmap
add, add, add, add, add, addN, addOffset, and, andNot, append, bitmapOf, bitmapOfRange, checkedAdd, checkedRemove, clear, deserialize, deserialize, flip, flip, flip, flip, getMappeableRoaringArray, iterator, lazyor, lazyorfromlazyinputs, maximumSerializedSize, naivelazyor, or, or, orNot, rangeSanityCheck, readExternal, remove, remove, remove, remove, removeRunCompression, repairAfterLazy, runOptimize, toImmutableRoaringBitmap, trim, writeExternal, xorMethods inherited from class org.roaringbitmap.buffer.ImmutableRoaringBitmap
and, and, and, andCardinality, andNot, andNot, andNot, andNotCardinality, cardinalityExceeds, contains, contains, contains, equals, first, firstSigned, flip, flip, forEach, getBatchIterator, getCardinality, getContainerCount, getContainerPointer, getIntIterator, getLongCardinality, getLongSizeInBytes, getReverseIntIterator, getSignedIntIterator, getSizeInBytes, hashCode, hasRunCompression, intersects, intersects, isEmpty, isHammingSimilar, last, lastSigned, lazyor, limit, nextAbsentValue, nextValue, or, or, or, or, orCardinality, orNot, previousAbsentValue, previousValue, rangeCardinality, rank, rankLong, select, selectRange, serialize, serialize, serializedSizeInBytes, toArray, toMutableRoaringBitmap, toMutableRoaringBitmapCopyOnWrite, toRoaringBitmap, toString, validate, xor, xor, xor, xorCardinalityMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.roaringbitmap.ImmutableBitmapDataProvider
contains, first, firstSigned, forEach, getBatchIterator, getCardinality, getContainerCount, getIntIterator, getLongCardinality, getLongSizeInBytes, getReverseIntIterator, getSignedIntIterator, getSizeInBytes, isEmpty, last, lastSigned, limit, nextAbsentValue, nextValue, previousAbsentValue, previousValue, rangeCardinality, rank, rankLong, reverseStream, select, serialize, serialize, serializedSizeInBytes, stream, toArrayMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CopyOnWriteRoaringBitmap
public CopyOnWriteRoaringBitmap()Create a new copy-on-write bitmap.
-
-
Method Details
-
fromImmutable
Create a copy-on-write bitmap from an immutable bitmap. -
add
public void add(int x) Description copied from class:MutableRoaringBitmapAdd the value to the container (set the value to "true"), whether it already appears or not. Java lacks native unsigned integers but the x argument is considered to be unsigned. Within bitmaps, numbers are ordered according toInteger.compareUnsigned(int, int). We order the numbers like 0, 1, ..., 2147483647, -2147483648, -2147483647,..., -1.- Specified by:
addin interfaceBitmapDataProvider- Overrides:
addin classMutableRoaringBitmap- Parameters:
x- integer value
-
remove
public void remove(int x) Description copied from class:MutableRoaringBitmapIf present remove the specified integers (effectively, sets its bit value to false)- Specified by:
removein interfaceBitmapDataProvider- Overrides:
removein classMutableRoaringBitmap- Parameters:
x- integer value representing the index in a bitmap
-
flip
public void flip(int x) Description copied from class:MutableRoaringBitmapAdd the value if it is not already present, otherwise remove it.- Overrides:
flipin classMutableRoaringBitmap- Parameters:
x- integer value
-
or
Description copied from class:MutableRoaringBitmapIn-place bitwise OR (union) operation. The current bitmap is modified.- Overrides:
orin classMutableRoaringBitmap- Parameters:
x2- other bitmap
-
and
Description copied from class:MutableRoaringBitmapIn-place bitwise AND (intersection) operation. The current bitmap is modified.- Overrides:
andin classMutableRoaringBitmap- Parameters:
x2- other bitmap
-
xor
Description copied from class:MutableRoaringBitmapIn-place bitwise XOR (symmetric difference) operation. The current bitmap is modified.- Overrides:
xorin classMutableRoaringBitmap- Parameters:
x2- other bitmap
-
andNot
Description copied from class:MutableRoaringBitmapIn-place bitwise ANDNOT (difference) operation. The current bitmap is modified.- Overrides:
andNotin classMutableRoaringBitmap- Parameters:
x2- other bitmap
-
clone
- Overrides:
clonein classMutableRoaringBitmap
-