Module org.apache.lucene.core
Package org.apache.lucene.util.packed
Class AbstractPagedMutable<T extends AbstractPagedMutable<T>>
java.lang.Object
org.apache.lucene.util.LongValues
org.apache.lucene.util.packed.AbstractPagedMutable<T>
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
PagedGrowableWriter,PagedMutable
public abstract class AbstractPagedMutable<T extends AbstractPagedMutable<T>>
extends LongValues
implements Accountable
Base implementation for
PagedMutable and PagedGrowableWriter.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int(package private) static final int(package private) static final int(package private) final int(package private) final int(package private) final long(package private) final PackedInts.Mutable[]Fields inherited from class org.apache.lucene.util.LongValues
IDENTITY, ZEROESFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longprotected final voidfinal longget(long index) Get value atindex.final Tgrow()Similar toArrayUtil.grow(long[]).final Tgrow(long minSize) Similar toArrayUtil.grow(long[], int).(package private) final intindexInPage(long index) (package private) final intlastPageSize(long size) protected abstract PackedInts.MutablenewMutable(int valueCount, int bitsPerValue) protected abstract TnewUnfilledCopy(long newSize) (package private) final intpageIndex(long index) (package private) final intpageSize()longReturn the memory usage of this object in bytes.final Tresize(long newSize) Create a new copy of sizenewSizebased on the content of this buffer.final voidset(long index, long value) Set value atindex.final longsize()The number of values.final StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
MIN_BLOCK_SIZE
static final int MIN_BLOCK_SIZE- See Also:
-
MAX_BLOCK_SIZE
static final int MAX_BLOCK_SIZE- See Also:
-
size
final long size -
pageShift
final int pageShift -
pageMask
final int pageMask -
subMutables
-
bitsPerValue
final int bitsPerValue
-
-
Constructor Details
-
AbstractPagedMutable
AbstractPagedMutable(int bitsPerValue, long size, int pageSize)
-
-
Method Details
-
fillPages
protected final void fillPages() -
newMutable
-
lastPageSize
final int lastPageSize(long size) -
pageSize
final int pageSize() -
size
public final long size()The number of values. -
pageIndex
final int pageIndex(long index) -
indexInPage
final int indexInPage(long index) -
get
public final long get(long index) Description copied from class:LongValuesGet value atindex.- Specified by:
getin classLongValues
-
set
public final void set(long index, long value) Set value atindex. -
baseRamBytesUsed
protected long baseRamBytesUsed() -
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
newUnfilledCopy
-
resize
Create a new copy of sizenewSizebased on the content of this buffer. This method is much more efficient than creating a new instance and copying values one by one. -
grow
Similar toArrayUtil.grow(long[], int). -
grow
Similar toArrayUtil.grow(long[]). -
toString
-