Class CharacterUtils
Character
Inheritance
Inherited Members
Namespace: Lucene.Net.Analysis.Util
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public abstract class CharacterUtils
Methods
| Improve this Doc View SourceCodePointAt(ICharSequence, Int32)
Returns the code point at the given index of the J2N.Character.CodePointAt(char[], int)
as it would have been
available on a Java 1.4 JVM or on a later virtual machine version.
Declaration
public abstract int CodePointAt(ICharSequence seq, int offset)
Parameters
Type | Name | Description |
---|---|---|
J2N. |
seq | a character sequence |
System. |
offset | the offset to the char values in the chars array to be converted |
Returns
Type | Description |
---|---|
System. |
the Unicode code point at the given index |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
CodePointAt(Char[], Int32, Int32)
Returns the code point at the given index of the char array where only elements
with index less than the limit are used.
Depending on the Lucene.Character.CodePointAt(char[], int)
as it would have been
available on a Java 1.4 JVM or on a later virtual machine version.
Declaration
public abstract int CodePointAt(char[] chars, int offset, int limit)
Parameters
Type | Name | Description |
---|---|---|
System. |
chars | a character array |
System. |
offset | the offset to the char values in the chars array to be converted |
System. |
limit | the index afer the last element that should be used to calculate codepoint. |
Returns
Type | Description |
---|---|
System. |
the Unicode code point at the given index |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
CodePointAt(String, Int32)
Returns the code point at the given index of the System.Character.CodePointAt(char[], int)
as it would have been
available on a Java 1.4 JVM or on a later virtual machine version.
Declaration
public abstract int CodePointAt(string seq, int offset)
Parameters
Type | Name | Description |
---|---|---|
System. |
seq | a character sequence |
System. |
offset | the offset to the char values in the chars array to be converted |
Returns
Type | Description |
---|---|
System. |
the Unicode code point at the given index |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
CodePointCount(ICharSequence)
Return the number of characters in seq
.
Declaration
public abstract int CodePointCount(ICharSequence seq)
Parameters
Type | Name | Description |
---|---|---|
J2N. |
seq |
Returns
Type | Description |
---|---|
System. |
CodePointCount(Char[])
Return the number of characters in seq
.
Declaration
public abstract int CodePointCount(char[] seq)
Parameters
Type | Name | Description |
---|---|---|
System. |
seq |
Returns
Type | Description |
---|---|
System. |
CodePointCount(String)
Return the number of characters in seq
.
Declaration
public abstract int CodePointCount(string seq)
Parameters
Type | Name | Description |
---|---|---|
System. |
seq |
Returns
Type | Description |
---|---|
System. |
CodePointCount(StringBuilder)
Return the number of characters in seq
.
Declaration
public abstract int CodePointCount(StringBuilder seq)
Parameters
Type | Name | Description |
---|---|---|
System. |
seq |
Returns
Type | Description |
---|---|
System. |
Fill(CharacterUtils.CharacterBuffer, TextReader)
Convenience method which calls Fill(buffer, reader, buffer.Buffer.Length)
.
Declaration
public virtual bool Fill(CharacterUtils.CharacterBuffer buffer, TextReader reader)
Parameters
Type | Name | Description |
---|---|---|
Character |
buffer | |
System. |
reader |
Returns
Type | Description |
---|---|
System. |
Fill(CharacterUtils.CharacterBuffer, TextReader, Int32)
Fills the Character
numChars
characters into the Character0
up to numChars
.
In case code points can span across 2 java characters, this method may
only fill numChars - 1
characters in order not to split in
the middle of a surrogate pair, even if there are remaining characters in
the System.
Depending on the Lucene.
A return value of false
means that this method call exhausted
the reader, but there may be some bytes which have been read, which can be
verified by checking whether buffer.Length > 0
.
Declaration
public abstract bool Fill(CharacterUtils.CharacterBuffer buffer, TextReader reader, int numChars)
Parameters
Type | Name | Description |
---|---|---|
Character |
buffer | the buffer to fill. |
System. |
reader | the reader to read characters from. |
System. |
numChars | the number of chars to read |
Returns
Type | Description |
---|---|
System. |
if and only if reader.read returned -1 while trying to fill the buffer |
Exceptions
Type | Condition |
---|---|
System. |
if the reader throws an System. |
GetInstance(LuceneVersion)
Returns a Character
Declaration
public static CharacterUtils GetInstance(LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
Lucene. |
matchVersion | a version instance |
Returns
Type | Description |
---|---|
Character |
a Character |
GetJava4Instance(LuceneVersion)
Return a Character
Declaration
public static CharacterUtils GetJava4Instance(LuceneVersion matchVersion)
Parameters
Type | Name | Description |
---|---|---|
Lucene. |
matchVersion |
Returns
Type | Description |
---|---|
Character |
NewCharacterBuffer(Int32)
Creates a new Character
Declaration
public static CharacterUtils.CharacterBuffer NewCharacterBuffer(int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System. |
bufferSize | the internal char buffer size, must be |
Returns
Type | Description |
---|---|
Character |
a new Character |
OffsetByCodePoints(Char[], Int32, Int32, Int32, Int32)
Return the index within buf[start:start+count]
which is by offset
code points from index
.
Declaration
public abstract int OffsetByCodePoints(char[] buf, int start, int count, int index, int offset)
Parameters
Type | Name | Description |
---|---|---|
System. |
buf | |
System. |
start | |
System. |
count | |
System. |
index | |
System. |
offset |
Returns
Type | Description |
---|---|
System. |
ToChars(Int32[], Int32, Int32, Char[], Int32)
Converts a sequence of unicode code points to a sequence of .NET characters.
Declaration
public int ToChars(int[] src, int srcOff, int srcLen, char[] dest, int destOff)
Parameters
Type | Name | Description |
---|---|---|
System. |
src | |
System. |
srcOff | |
System. |
srcLen | |
System. |
dest | |
System. |
destOff |
Returns
Type | Description |
---|---|
System. |
the number of chars written to the destination buffer |
ToCodePoints(Char[], Int32, Int32, Int32[], Int32)
Converts a sequence of .NET characters to a sequence of unicode code points.
Declaration
public int ToCodePoints(char[] src, int srcOff, int srcLen, int[] dest, int destOff)
Parameters
Type | Name | Description |
---|---|---|
System. |
src | |
System. |
srcOff | |
System. |
srcLen | |
System. |
dest | |
System. |
destOff |
Returns
Type | Description |
---|---|
System. |
The number of code points written to the destination buffer. |
ToLower(Char[], Int32, Int32)
Converts each unicode codepoint to lowerCase via System.
Declaration
public virtual void ToLower(char[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
buffer | the char buffer to lowercase |
System. |
offset | the offset to start at |
System. |
length | the number of characters in the buffer to lower case |
ToUpper(Char[], Int32, Int32)
Converts each unicode codepoint to UpperCase via System.
Declaration
public virtual void ToUpper(char[] buffer, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
buffer | the char buffer to UPPERCASE |
System. |
offset | the offset to start at |
System. |
length | the number of characters in the buffer to lower case |