Class UnescapedCharSequence
J2N.Text.ICharSequence with escaped chars information.
Implements
Inherited Members
Namespace: Lucene.Net.QueryParsers.Flexible.Core.Util
Assembly: Lucene.Net.QueryParser.dll
Syntax
public sealed class UnescapedCharSequence : ICharSequence
Constructors
UnescapedCharSequence(ICharSequence)
Create a non-escaped J2N.Text.ICharSequence
Declaration
public UnescapedCharSequence(ICharSequence text)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text |
UnescapedCharSequence(char[], bool[], int, int)
Create a escaped J2N.Text.ICharSequence
Declaration
public UnescapedCharSequence(char[] chars, bool[] wasEscaped, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
char[] | chars | |
bool[] | wasEscaped | |
int | offset | |
int | length |
UnescapedCharSequence(string)
Create a non-escaped string
Declaration
public UnescapedCharSequence(string text)
Parameters
Type | Name | Description |
---|---|---|
string | text |
UnescapedCharSequence(StringBuilder)
Create a non-escaped StringBuilder
Declaration
public UnescapedCharSequence(StringBuilder text)
Parameters
Type | Name | Description |
---|---|---|
StringBuilder | text |
Properties
this[int]
Gets the character at the specified index, with the first character having index zero.
Declaration
public char this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the character to return. |
Property Value
Type | Description |
---|---|
char | The requested character. |
Exceptions
Type | Condition |
---|---|
IndexOutOfRangeException | If |
InvalidOperationException | If the underlying value of this sequence is |
Length
Gets the number of characters in this sequence.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Subsequence(int, int)
Retrieves a sub-sequence from this instance. The sub-sequence starts at a specified character position and has a specified length.
IMPORTANT: This method has .NET semantics, that is, the second parameter is a length, not an exclusive end index as it would be in Java. To translate from Java to .NET, callers must account for this by subtracting (end - start) for thelength
.
Declaration
public ICharSequence Subsequence(int startIndex, int length)
Parameters
Type | Name | Description |
---|---|---|
int | startIndex | The start index of the sub-sequence. It is inclusive, that is, the index of the first character that is included in the sub-sequence. |
int | length | The number of characters to return in the sub-sequence. |
Returns
Type | Description |
---|---|
ICharSequence |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
startIndex or length is less than zero.
|
ToLower(ICharSequence, CultureInfo)
J2N.Text.ICharSequence with escaped chars information.
Declaration
public static ICharSequence ToLower(ICharSequence text, CultureInfo locale)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | |
CultureInfo | locale |
Returns
Type | Description |
---|---|
ICharSequence |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
ToStringEscaped()
Return an escaped string
Declaration
public string ToStringEscaped()
Returns
Type | Description |
---|---|
string | an escaped string |
ToStringEscaped(char[])
Return an escaped string
Declaration
public ICharSequence ToStringEscaped(char[] enabledChars)
Parameters
Type | Name | Description |
---|---|---|
char[] | enabledChars | array of chars to be escaped |
Returns
Type | Description |
---|---|
ICharSequence | an escaped string |
WasEscaped(ICharSequence, int)
J2N.Text.ICharSequence with escaped chars information.
Declaration
public static bool WasEscaped(ICharSequence text, int index)
Parameters
Type | Name | Description |
---|---|---|
ICharSequence | text | |
int | index |
Returns
Type | Description |
---|---|
bool |
WasEscaped(int)
J2N.Text.ICharSequence with escaped chars information.
Declaration
public bool WasEscaped(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
Returns
Type | Description |
---|---|
bool |