abstract class ReversibleString
(source)
A String wrapper utility that allows for efficient string reversal. We regularly need to reverse strings. The standard way of doing this in Java would be to copy the string to reverse (e.g. using StringBuffer.reverse()). This seems wasteful when we only read our Strings character by character, in which case can just transpose positions as needed.
abstract val isReversed: Boolean |
|
val offsetEnd: Int |
|
val offsetStart: Int |
|
val string: String |
abstract fun charAt(position: Int): Char |
|
fun length(): Int
Returns the length of this string. |
|
fun reverse(): ReversibleString
Reverses this string. |
|
abstract fun substring(startIndex: Int): ReversibleString |
fun create(string: String): ReversibleString
Create a ReversibleString for the provided String. |