Package org.apache.lucene.util.packed
Class PackedLongValues.Builder
java.lang.Object
org.apache.lucene.util.packed.PackedLongValues.Builder
- All Implemented Interfaces:
Accountable
- Enclosing class:
PackedLongValues
A Builder for a
PackedLongValues instance.-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionadd(long l) Add a new element to this builder.add(long value, int count) Addcountcopies ofvaluein bulk.add(LongValuesCursor cursor) Add all values produced by the givenLongValuesCursorin bulk.build()Build aPackedLongValuesinstance that contains values that have been added to this builder.final longReturns an estimate of the JVM heap memory used by this object in bytes.final longsize()Return the number of elements that have been added to this builder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Method Details
-
build
Build aPackedLongValuesinstance that contains values that have been added to this builder. This operation is destructive. -
ramBytesUsed
public final long ramBytesUsed()Description copied from interface:AccountableReturns an estimate of the JVM heap memory used by this object in bytes. The method name uses "ram" for historical reasons; only JVM heap memory should be reported. Off-heap resources such as memory-mapped files or native direct buffers should not be included. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
size
public final long size()Return the number of elements that have been added to this builder. -
add
Add a new element to this builder. -
add
Addcountcopies ofvaluein bulk. -
add
Add all values produced by the givenLongValuesCursorin bulk. The cursor'sLongValuesCursor.size()is used as the bounds: exactly that many values are pulled.
-