类 ContainerAppender<C extends WordStorage<C>,T extends BitmapDataProvider & AppendableStorage<C>>
java.lang.Object
org.bitlap.roaringbitmap.ContainerAppender<C,T>
- 所有已实现的接口:
Supplier<T>,RoaringBitmapWriter<T>
public class ContainerAppender<C extends WordStorage<C>,T extends BitmapDataProvider & AppendableStorage<C>>
extends Object
implements RoaringBitmapWriter<T>
This class can be used to write quickly values to a bitmap.
The values are expected to be (increasing) sorted order.
Values are first written to a temporary internal buffer, but
the underlying bitmap can forcefully synchronize by calling "flush"
(although calling flush to often would defeat the performance
purpose of this class).
The main use case for an ContainerAppender is to get bitmaps quickly.
You should benchmark your particular use case to see if it helps.
//...
RoaringBitmapWriter<RoaringBitmap> writer =
RoaringBitmapWriter.writer().get();
for (int i :....) {
writer.add(i);
}
writer.flush(); // important
-
嵌套类概要
从接口继承的嵌套类/接口 org.bitlap.roaringbitmap.RoaringBitmapWriter
RoaringBitmapWriter.BufferWizard, RoaringBitmapWriter.FastRankRoaringBitmapWizard, RoaringBitmapWriter.RoaringBitmapWizard, RoaringBitmapWriter.RoaringWizard<T extends RoaringBitmap>, RoaringBitmapWriter.Wizard<C extends WordStorage<C>,T extends BitmapDataProvider & AppendableStorage<C>> -
方法概要
修饰符和类型方法说明voidadd(int value) Adds the value to the underlying bitmap.voidadd(long min, long max) Add a range to the bitmapvoidaddMany(int... values) Adds many values to the bitmap.voidflush()Ensures that any buffered additions are flushed to the underlying bitmap.Grab a reference to the underlying bitmapvoidreset()Resets the writer so it can be reused, must release the reference to the underlying bitmap从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.bitlap.roaringbitmap.RoaringBitmapWriter
get
-
方法详细资料
-
getUnderlying
Grab a reference to the underlying bitmap- 指定者:
getUnderlying在接口中RoaringBitmapWriter<C extends WordStorage<C>>- 返回:
- the underlying bitmap
-
add
public void add(int value) Adds the value to the underlying bitmap. The data might be added to a temporary buffer. You should call "flush" when you are done.- 指定者:
add在接口中RoaringBitmapWriter<C extends WordStorage<C>>- 参数:
value- the value to add.
-
add
public void add(long min, long max) 从接口复制的说明:RoaringBitmapWriterAdd a range to the bitmap- 指定者:
add在接口中RoaringBitmapWriter<C extends WordStorage<C>>- 参数:
min- the inclusive min valuemax- the exclusive max value
-
addMany
public void addMany(int... values) 从接口复制的说明:RoaringBitmapWriterAdds many values to the bitmap.- 指定者:
addMany在接口中RoaringBitmapWriter<C extends WordStorage<C>>- 参数:
values- the values to add
-
flush
public void flush()Ensures that any buffered additions are flushed to the underlying bitmap.- 指定者:
flush在接口中RoaringBitmapWriter<C extends WordStorage<C>>
-
reset
public void reset()从接口复制的说明:RoaringBitmapWriterResets the writer so it can be reused, must release the reference to the underlying bitmap- 指定者:
reset在接口中RoaringBitmapWriter<C extends WordStorage<C>>
-