Show / Hide Table of Contents

    Class CharsRef

    Represents char[], as a slice (offset + Length) into an existing char[]. The Chars property should never be null; use EMPTY_CHARS if necessary.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    CharsRef
    Implements
    ICharSequence
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class CharsRef : IComparable<CharsRef>, ICharSequence

    Constructors

    | Improve this Doc View Source

    CharsRef()

    Creates a new CharsRef initialized an empty array zero-Length

    Declaration
    public CharsRef()
    | Improve this Doc View Source

    CharsRef(Char[], Int32, Int32)

    Creates a new CharsRef initialized with the given chars, offset and length.

    Declaration
    public CharsRef(char[] chars, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] chars
    System.Int32 offset
    System.Int32 length
    | Improve this Doc View Source

    CharsRef(Int32)

    Creates a new CharsRef initialized with an array of the given capacity.

    Declaration
    public CharsRef(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity
    | Improve this Doc View Source

    CharsRef(String)

    Creates a new CharsRef initialized with the given character array.

    Declaration
    public CharsRef(string string)
    Parameters
    Type Name Description
    System.String string

    Fields

    | Improve this Doc View Source

    EMPTY_CHARS

    An empty character array for convenience

    Declaration
    public static readonly char[] EMPTY_CHARS
    Field Value
    Type Description
    System.Char[]

    Properties

    | Improve this Doc View Source

    Chars

    The contents of the CharsRef. Should never be null.

    Declaration
    public char[] Chars { get; set; }
    Property Value
    Type Description
    System.Char[]
    | Improve this Doc View Source

    Item[Int32]

    Declaration
    public char this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    System.Char
    | Improve this Doc View Source

    Length

    Length of used characters.

    Declaration
    public int Length { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Offset

    Offset of first valid character.

    Declaration
    public int Offset { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    UTF16SortedAsUTF8Comparer

    Declaration
    public static IComparer<CharsRef> UTF16SortedAsUTF8Comparer { get; }
    Property Value
    Type Description
    IComparer<CharsRef>

    Methods

    | Improve this Doc View Source

    Append(Char[], Int32, Int32)

    Appends the given array to this CharsRef.

    Declaration
    public void Append(char[] otherChars, int otherOffset, int otherLength)
    Parameters
    Type Name Description
    System.Char[] otherChars
    System.Int32 otherOffset
    System.Int32 otherLength
    | Improve this Doc View Source

    CharsEquals(CharsRef)

    Declaration
    public bool CharsEquals(CharsRef other)
    Parameters
    Type Name Description
    CharsRef other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Clone()

    Returns a shallow clone of this instance (the underlying characters are not copied and will be shared by both the returned object and this object.

    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object
    See Also
    DeepCopyOf(CharsRef)
    | Improve this Doc View Source

    CompareTo(CharsRef)

    Signed order comparison

    Declaration
    public int CompareTo(CharsRef other)
    Parameters
    Type Name Description
    CharsRef other
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    CopyChars(CharsRef)

    Copies the given CharsRef referenced content into this instance.

    Declaration
    public void CopyChars(CharsRef other)
    Parameters
    Type Name Description
    CharsRef other

    The CharsRef to copy.

    | Improve this Doc View Source

    CopyChars(Char[], Int32, Int32)

    Copies the given array into this CharsRef.

    Declaration
    public void CopyChars(char[] otherChars, int otherOffset, int otherLength)
    Parameters
    Type Name Description
    System.Char[] otherChars
    System.Int32 otherOffset
    System.Int32 otherLength
    | Improve this Doc View Source

    DeepCopyOf(CharsRef)

    Creates a new CharsRef that points to a copy of the chars from other.

    The returned CharsRef will have a Length of other.Length and an offset of zero.

    Declaration
    public static CharsRef DeepCopyOf(CharsRef other)
    Parameters
    Type Name Description
    CharsRef other
    Returns
    Type Description
    CharsRef
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    System.Object other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    Grow(Int32)

    Used to grow the reference array.

    In general this should not be used as it does not take the offset into account.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Declaration
    public void Grow(int newLength)
    Parameters
    Type Name Description
    System.Int32 newLength
    | Improve this Doc View Source

    IsValid()

    Performs internal consistency checks. Always returns true (or throws )

    Declaration
    public bool IsValid()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    SubSequence(Int32, Int32)

    Declaration
    public ICharSequence SubSequence(int start, int end)
    Parameters
    Type Name Description
    System.Int32 start
    System.Int32 end
    Returns
    Type Description
    ICharSequence
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    Implements

    ICharSequence
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)