Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class GrowableWriter

    Implements PackedInt32s.Mutable, but grows the bit count of the underlying packed ints on-demand.

    Beware that this class will accept to set negative values but in order to do this, it will grow the number of bits per value to 64.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    NumericDocValues
    PackedInt32s.Reader
    PackedInt32s.Mutable
    GrowableWriter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util.Packed
    Assembly: Lucene.Net.dll
    Syntax
    public class GrowableWriter : PackedInt32s.Mutable

    Constructors

    GrowableWriter(int, int, float)

    Implements PackedInt32s.Mutable, but grows the bit count of the underlying packed ints on-demand.

    Beware that this class will accept to set negative values but in order to do this, it will grow the number of bits per value to 64.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public GrowableWriter(int startBitsPerValue, int valueCount, float acceptableOverheadRatio)
    Parameters
    Type Name Description
    int startBitsPerValue

    the initial number of bits per value, may grow depending on the data

    int valueCount

    the number of values

    float acceptableOverheadRatio

    an acceptable overhead ratio

    Properties

    BitsPerValue

    Implements PackedInt32s.Mutable, but grows the bit count of the underlying packed ints on-demand.

    Beware that this class will accept to set negative values but in order to do this, it will grow the number of bits per value to 64.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public override int BitsPerValue { get; }
    Property Value
    Type Description
    int

    The number of bits used to store any given value. Note: this does not imply that memory usage is bitsPerValue * #values as implementations are free to use non-space-optimal packing of bits.

    Overrides
    PackedInt32s.Reader.BitsPerValue

    Count

    The number of values.

    NOTE: This was size() in Lucene.
    Declaration
    public override int Count { get; }
    Property Value
    Type Description
    int
    Overrides
    PackedInt32s.Reader.Count

    HasArray

    Returns true if this implementation is backed by a native .NET array.

    Declaration
    public override bool HasArray { get; }
    Property Value
    Type Description
    bool
    Overrides
    PackedInt32s.Reader.HasArray
    See Also
    GetArray()

    Mutable

    Implements PackedInt32s.Mutable, but grows the bit count of the underlying packed ints on-demand.

    Beware that this class will accept to set negative values but in order to do this, it will grow the number of bits per value to 64.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public virtual PackedInt32s.Mutable Mutable { get; }
    Property Value
    Type Description
    PackedInt32s.Mutable

    Methods

    Clear()

    Sets all values to 0.

    Declaration
    public override void Clear()
    Overrides
    PackedInt32s.Mutable.Clear()

    Fill(int, int, long)

    Fill the mutable from fromIndex (inclusive) to toIndex (exclusive) with val.

    Declaration
    public override void Fill(int fromIndex, int toIndex, long val)
    Parameters
    Type Name Description
    int fromIndex
    int toIndex
    long val
    Overrides
    PackedInt32s.Mutable.Fill(int, int, long)

    Get(int)

    Returns the numeric value for the specified document ID.

    Declaration
    public override long Get(int index)
    Parameters
    Type Name Description
    int index
    Returns
    Type Description
    long

    numeric value

    Overrides
    NumericDocValues.Get(int)

    Get(int, long[], int, int)

    Bulk get: read at least one and at most len longs starting from index into arr[off:off+len] and return the actual number of values that have been read.

    Declaration
    public override int Get(int index, long[] arr, int off, int len)
    Parameters
    Type Name Description
    int index
    long[] arr
    int off
    int len
    Returns
    Type Description
    int
    Overrides
    PackedInt32s.Reader.Get(int, long[], int, int)

    GetArray()

    Expert: if the bit-width of this reader matches one of .NET's native types, returns the underlying array (ie, byte[], short[], int[], long[]); else, returns null. Note that when accessing the array you must upgrade the type (bitwise AND with all ones), to interpret the full value as unsigned. Ie, bytes[idx]&0xFF, shorts[idx]&0xFFFF, etc.

    Declaration
    public override object GetArray()
    Returns
    Type Description
    object
    Overrides
    PackedInt32s.Reader.GetArray()

    RamBytesUsed()

    Return the in-memory size in bytes.

    Declaration
    public override long RamBytesUsed()
    Returns
    Type Description
    long
    Overrides
    PackedInt32s.Reader.RamBytesUsed()

    Resize(int)

    Implements PackedInt32s.Mutable, but grows the bit count of the underlying packed ints on-demand.

    Beware that this class will accept to set negative values but in order to do this, it will grow the number of bits per value to 64.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Declaration
    public virtual GrowableWriter Resize(int newSize)
    Parameters
    Type Name Description
    int newSize
    Returns
    Type Description
    GrowableWriter

    Save(DataOutput)

    Save this mutable into out. Instantiating a reader from the generated data will return a reader with the same number of bits per value.

    Declaration
    public override void Save(DataOutput @out)
    Parameters
    Type Name Description
    DataOutput out
    Overrides
    PackedInt32s.Mutable.Save(DataOutput)

    Set(int, long)

    Set the value at the given index in the array.

    Declaration
    public override void Set(int index, long value)
    Parameters
    Type Name Description
    int index

    Where the value should be positioned.

    long value

    A value conforming to the constraints set by the array.

    Overrides
    PackedInt32s.Mutable.Set(int, long)

    Set(int, long[], int, int)

    Bulk set: set at least one and at most len longs starting at off in arr into this mutable, starting at index. Returns the actual number of values that have been set.

    Declaration
    public override int Set(int index, long[] arr, int off, int len)
    Parameters
    Type Name Description
    int index
    long[] arr
    int off
    int len
    Returns
    Type Description
    int
    Overrides
    PackedInt32s.Mutable.Set(int, long[], int, int)
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.