AlteredCharSequence
open classAlteredCharSequence: CharSequence, GetChars
| kotlin.Any | |
| ↳ | android.text.AlteredCharSequence |
An AlteredCharSequence is a CharSequence that is largely mirrored from another CharSequence, except that a specified range of characters are mirrored from a different char array instead.
Summary
| Public methods | |
|---|---|
| open Char |
Returns the |
| open Unit |
Copies characters from this sequence into the given destination array. |
| open static AlteredCharSequence! |
make(source: CharSequence!, sub: CharArray!, substart: Int, subend: Int)Create an AlteredCharSequence whose text (and possibly spans) are mirrored from |
| open CharSequence |
subSequence(startIndex: Int, endIndex: Int)Returns a |
| open String |
toString()Returns a string representation of the object. |
| Properties | |
|---|---|
| open Int |
Returns the length of this character sequence. |
Public methods
get
open funget(off: Int): Char
Deprecated: Deprecated in Java.
Returns the char value at the specified index. An index ranges from zero to length() - 1. The first char value of the sequence is at index zero, the next at index one, and so on, as for array indexing.
If the char value specified by the index is a surrogate, the surrogate value is returned.
| Parameters | |
|---|---|
index |
the index of the char value to be returned |
| Return | |
|---|---|
Char |
the specified char value |
| Exceptions | |
|---|---|
java.lang.IndexOutOfBoundsException |
if the index argument is negative or not less than length() |
getChars
open fungetChars(
start: Int,
end: Int,
dest: CharArray,
off: Int
): Unit
Deprecated: Deprecated in Java.
Copies characters from this sequence into the given destination array. The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1. The total number of characters to be copied is srcEnd-srcBegin. The characters are copied into the subarray of dst starting at index dstBegin and ending at index:
<code>dstbegin + (srcEnd-srcBegin) - 1 </code>
| Parameters | |
|---|---|
srcBegin |
start copying at this offset. |
srcEnd |
stop copying at this offset. |
dst |
the array to copy the data into. |
dstBegin |
offset into dst. |
| Exceptions | |
|---|---|
java.lang.IndexOutOfBoundsException |
if any of the following is true:
|
java.lang.NullPointerException |
if dst is null |
make
open static funmake(
source: CharSequence!,
sub: CharArray!,
substart: Int,
subend: Int
): AlteredCharSequence!
Deprecated: Deprecated in Java.
Create an AlteredCharSequence whose text (and possibly spans) are mirrored from source, except that the range of offsets substart inclusive to subend exclusive are mirrored instead from sub, beginning at offset 0.
subSequence
open funsubSequence(
startIndex: Int,
endIndex: Int
): CharSequence
Deprecated: Deprecated in Java.
Returns a CharSequence that is a subsequence of this sequence. The subsequence starts with the char value at the specified index and ends with the char value at index end - 1. The length (in chars) of the returned sequence is end - start, so if start == end then an empty sequence is returned.
| Parameters | |
|---|---|
start |
the start index, inclusive |
end |
the end index, exclusive |
| Return | |
|---|---|
CharSequence |
the specified subsequence |
| Exceptions | |
|---|---|
java.lang.IndexOutOfBoundsException |
if start or end are negative, if end is greater than length(), or if start is greater than end |
toString
open funtoString(): String
Deprecated: Deprecated in Java.
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string consisting of exactly this sequence of characters |
Properties
length
open val length: Int
Returns the length of this character sequence. The length is the number of 16-bit chars in the sequence.
| Return | |
|---|---|
Int |
the number of chars in this sequence |