Class CharacterUtils
CharacterUtils provides a unified interface to Character-related operations to implement backwards compatible character operations based on a LuceneVersion instance.
@lucene.internal
Inheritance
Inherited Members
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
[Serializable]
public abstract class CharacterUtils
Methods
Name | Description |
---|---|
CodePointAt(ICharSequence, Int32) | |
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 LuceneVersion passed to
GetInstance(LuceneVersion) this method mimics the behavior
of |
CodePointAt(String, Int32) | Returns the code point at the given index of the ICharSequence.
Depending on the LuceneVersion passed to
GetInstance(LuceneVersion) this method mimics the behavior
of |
CodePointCount(String) | Return the number of characters in |
Fill(CharacterUtils.CharacterBuffer, TextReader) | Convenience method which calls |
Fill(CharacterUtils.CharacterBuffer, TextReader, Int32) | Fills the CharacterUtils.CharacterBuffer with characters read from the given reader System.IO.TextReader. This method tries to read
characters into the CharacterUtils.CharacterBuffer, each call to fill will start
filling the buffer from offset 0 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.IO.TextReader.
Depending on the LuceneVersion passed to GetInstance(LuceneVersion) this method implements supplementary character awareness when filling the given buffer. For all LuceneVersion > 3.0 Fill(CharacterUtils.CharacterBuffer, TextReader, Int32) guarantees that the given CharacterUtils.CharacterBuffer will never contain a high surrogate character as the last element in the buffer unless it is the last available character in the reader. In other words, high and low surrogate pairs will always be preserved across buffer boarders.
A return value of |
GetInstance(LuceneVersion) | Returns a CharacterUtils implementation according to the given LuceneVersion instance. |
GetJava4Instance(LuceneVersion) | Return a CharacterUtils instance compatible with Java 1.4. |
NewCharacterBuffer(Int32) | Creates a new CharacterUtils.CharacterBuffer and allocates a char[] of the given bufferSize. |
OffsetByCodePoints(Char[], Int32, Int32, Int32, Int32) | Return the index within |
ToChars(Int32[], Int32, Int32, Char[], Int32) | Converts a sequence of unicode code points to a sequence of .NET characters. |
ToCodePoints(Char[], Int32, Int32, Int32[], Int32) | Converts a sequence of .NET characters to a sequence of unicode code points. |
ToLower(Char[], Int32, Int32) | Converts each unicode codepoint to lowerCase via ToLower(Int32) starting at the given offset. |
ToUpper(Char[], Int32, Int32) | Converts each unicode codepoint to UpperCase via ToUpper(Int32) starting at the given offset. |