Fork me on GitHub
  • API

    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!

    Note

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

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    BytesRefArray
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class BytesRefArray

    Constructors

    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

    Length

    Returns the current size of this BytesRefArray.

    NOTE: This was size() in Lucene.
    Declaration
    public int Length { get; }
    Property Value
    Type Description
    int

    The current size of this BytesRefArray

    Methods

    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
    int

    The index of the appended bytes

    Clear()

    Clears this BytesRefArray

    Declaration
    public void Clear()

    Get(BytesRef, int)

    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

    int index

    The elements index to retrieve

    Returns
    Type Description
    BytesRef

    The n'th element of this BytesRefArray

    GetEnumerator()

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

    Declaration
    public IBytesRefEnumerator GetEnumerator()
    Returns
    Type Description
    IBytesRefEnumerator

    GetEnumerator(IComparer<BytesRef>)

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

    If a non nullIComparer{BytesRef} is provided the enumerator 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 IBytesRefEnumerator GetEnumerator(IComparer<BytesRef> comparer)
    Parameters
    Type Name Description
    IComparer<BytesRef> comparer
    Returns
    Type Description
    IBytesRefEnumerator
    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.