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 forPagedMutableandPagedGrowableWriter.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.util.LongValues
IDENTITY, ZEROES
-
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected longbaseRamBytesUsed()protected voidfillPages()longget(long index)Get value atindex.Tgrow()Similar toArrayUtil.grow(long[]).Tgrow(long minSize)Similar toArrayUtil.grow(long[], int).protected abstract PackedInts.MutablenewMutable(int valueCount, int bitsPerValue)protected abstract TnewUnfilledCopy(long newSize)longramBytesUsed()Return the memory usage of this object in bytes.Tresize(long newSize)Create a new copy of sizenewSizebased on the content of this buffer.voidset(long index, long value)Set value atindex.longsize()The number of values.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Method Detail
-
fillPages
protected final void fillPages()
-
newMutable
protected abstract PackedInts.Mutable newMutable(int valueCount, int bitsPerValue)
-
size
public final long size()
The number of values.
-
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
protected abstract T newUnfilledCopy(long newSize)
-
resize
public final T resize(long newSize)
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
public final T grow(long minSize)
Similar toArrayUtil.grow(long[], int).
-
grow
public final T grow()
Similar toArrayUtil.grow(long[]).
-
-