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.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
Inheritance
System.Object
CharsRef
Implements
J2N.Text.ICharSequence
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Lucene.Net.dll
Syntax
[Serializable]
public sealed class CharsRef : IComparable<CharsRef>, ICharSequence, IEquatable<CharsRef>
Constructors
|
Improve this Doc
View Source
CharsRef()
Creates a new CharsRef initialized an empty array zero-Length
Declaration
|
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 System.String 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
[Obsolete("this comparer is only a transition mechanism")]
public static IComparer<CharsRef> UTF16SortedAsUTF8Comparer { get; }
Property Value
Type |
Description |
System.Collections.Generic.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
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
Returns
Type |
Description |
System.Object |
|
See Also
|
Improve this Doc
View Source
CompareTo(CharsRef)
Signed System.Int32 order comparison
Declaration
public int CompareTo(CharsRef other)
Parameters
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
|
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
Returns
|
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 |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
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.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
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 System.InvalidOperationException)
Declaration
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Subsequence(Int32, Int32)
Declaration
public ICharSequence Subsequence(int startIndex, int length)
Parameters
Type |
Name |
Description |
System.Int32 |
startIndex |
|
System.Int32 |
length |
|
Returns
Type |
Description |
J2N.Text.ICharSequence |
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Explicit Interface Implementations
|
Improve this Doc
View Source
ICharSequence.HasValue
Declaration
bool ICharSequence.HasValue { get; }
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IEquatable<CharsRef>.Equals(CharsRef)
Declaration
bool IEquatable<CharsRef>.Equals(CharsRef other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Implements
System.IComparable<T>
J2N.Text.ICharSequence
System.IEquatable<T>