Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class RollingCharBuffer

    Acts like a forever growing char[] as you read characters into it from the provided reader, but internally it uses a circular buffer to only hold the characters that haven't been freed yet. This is like a PushbackReader, except you don't have to specify up-front the max size of the buffer, but you do have to periodically call FreeBefore(int).

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

    Methods

    FreeBefore(int)

    Call this to notify us that no chars before this absolute position are needed anymore.

    Declaration
    public void FreeBefore(int pos)
    Parameters
    Type Name Description
    int pos

    Get(int)

    Absolute position read. NOTE: pos must not jump ahead by more than 1! Ie, it's OK to read arbitarily far back (just not prior to the last FreeBefore(int), but NOT ok to read arbitrarily far ahead. Returns -1 if you hit EOF.

    Declaration
    public int Get(int pos)
    Parameters
    Type Name Description
    int pos
    Returns
    Type Description
    int

    Get(int, int)

    Acts like a forever growing char[] as you read characters into it from the provided reader, but internally it uses a circular buffer to only hold the characters that haven't been freed yet. This is like a PushbackReader, except you don't have to specify up-front the max size of the buffer, but you do have to periodically call FreeBefore(int).

    Declaration
    public char[] Get(int posStart, int length)
    Parameters
    Type Name Description
    int posStart
    int length
    Returns
    Type Description
    char[]

    Reset(TextReader)

    Clear array and switch to new reader.

    Declaration
    public void Reset(TextReader reader)
    Parameters
    Type Name Description
    TextReader reader
    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.