Show / Hide Table of Contents

    Class BytesRefArray

    A simple append only random-access BytesRef array that stores full copies of the appended bytes in a ByteBlockPool.

    Note: this class is not Thread-Safe!

    @lucene.internal

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    BytesRefArray
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class BytesRefArray : object

    Constructors

    | Improve this Doc View Source

    BytesRefArray(Counter)

    Creates a new BytesRefArray with a counter to track allocated bytes

    Declaration
    public BytesRefArray(Counter bytesUsed)
    Parameters
    Type Name Description
    Counter bytesUsed

    Properties

    | Improve this Doc View Source

    Length

    Returns the current size of this BytesRefArray.

    NOTE: This was size() in Lucene.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    System.Int32

    The current size of this BytesRefArray

    Methods

    | Improve this Doc View Source

    Append(BytesRef)

    Appends a copy of the given BytesRef to this BytesRefArray.

    Declaration
    public int Append(BytesRef bytes)
    Parameters
    Type Name Description
    BytesRef bytes

    The bytes to append

    Returns
    Type Description
    System.Int32

    The index of the appended bytes

    | Improve this Doc View Source

    Clear()

    Clears this BytesRefArray

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Get(BytesRef, Int32)

    Returns the n'th element of this BytesRefArray

    Declaration
    public BytesRef Get(BytesRef spare, int index)
    Parameters
    Type Name Description
    BytesRef spare

    A spare BytesRef instance

    System.Int32 index

    The elements index to retrieve

    Returns
    Type Description
    BytesRef

    The n'th element of this BytesRefArray

    | Improve this Doc View Source

    GetIterator()

    Sugar for GetIterator(IComparer<BytesRef>) with a null comparer

    Declaration
    public IBytesRefIterator GetIterator()
    Returns
    Type Description
    IBytesRefIterator
    | Improve this Doc View Source

    GetIterator(IComparer<BytesRef>)

    Returns a IBytesRefIterator with point in time semantics. The iterator provides access to all so far appended BytesRef instances.

    If a non null IComparer<BytesRef> is provided the iterator will iterate the byte values in the order specified by the comparer. Otherwise the order is the same as the values were appended.

    This is a non-destructive operation.

    Declaration
    public IBytesRefIterator GetIterator(IComparer<BytesRef> comp)
    Parameters
    Type Name Description
    IComparer<BytesRef> comp
    Returns
    Type Description
    IBytesRefIterator
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)