public class StringBuilderSync extends Object
Thread-safe text builder.
This synchronized variant is intended for concurrent text assembly and produces standard Klyn String values.
It follows the same text model as String and StringBuilder:
size and length() count Unicode scalar values, not UTF-16 unitsU+0000'\u0000' is ordinary embeddable text, not a terminatorUse it for shared textual logs, prompts or generated source fragments. It must not be used as a binary container.
builder = StringBuilderSync()
builder.append("worker:")
builder.append(" 1")
print(builder.toString())| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | isEmptyisEmpty as Boolean |
Returns true when no character is present. |
| public readonly property | sizesize as ULong |
Returns the number of Unicode scalar values in the string builder. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | StringBuilderSyncStringBuilderSync(size as ULong = 256) |
Creates a new synchronized builder. |
| public | StringBuilderSyncStringBuilderSync(value as String) |
Creates a new synchronized builder initialized with text. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | appendappend(char as CodeUnit) as StringBuilderSync |
Appends one UTF-16 code unit to the builder. |
| public | appendappend(value as Boolean) as StringBuilderSync |
Appends a boolean. |
| public | appendappend(value as Byte) as StringBuilderSync |
Appends an unsigned byte. |
| public | appendappend(value as Char) as StringBuilderSync |
Appends one Unicode scalar to the builder. |
| public | appendappend(value as Double) as StringBuilderSync |
Appends a double. |
| public | appendappend(value as Float) as StringBuilderSync |
Appends a float. |
| public | appendappend(value as Int) as StringBuilderSync |
Appends a signed integer. |
| public | appendappend(value as Long) as StringBuilderSync |
Appends a signed long. |
| public | appendappend(value as Object) as StringBuilderSync |
Appends the string representation of an object. |
| public | appendappend(value as SByte) as StringBuilderSync |
Appends a signed byte. |
| public | appendappend(value as Short) as StringBuilderSync |
Appends a signed short. |
| public | appendappend(value as String) as StringBuilderSync |
Appends a string. |
| public | appendappend(value as UInt) as StringBuilderSync |
Appends an unsigned integer. |
| public | appendappend(value as ULong) as StringBuilderSync |
Appends an unsigned long. |
| public | appendappend(value as UShort) as StringBuilderSync |
Appends an unsigned short. |
| public | clearclear() as StringBuilderSync |
Clears current content. |
| public | insertinsert(position as Long, char as CodeUnit) as StringBuilderSync throws IndexException |
Inserts one UTF-16 code unit. |
| public | insertinsert(position as Long, value as Boolean) as StringBuilderSync throws IndexException |
Inserts a boolean. |
| public | insertinsert(position as Long, value as Byte) as StringBuilderSync throws IndexException |
Inserts an unsigned byte. |
| public | insertinsert(position as Long, value as Char) as StringBuilderSync throws IndexException |
Inserts one Unicode scalar. |
| public | insertinsert(position as Long, value as Double) as StringBuilderSync throws IndexException |
Inserts a double. |
| public | insertinsert(position as Long, value as Float) as StringBuilderSync throws IndexException |
Inserts a float. |
| public | insertinsert(position as Long, value as Int) as StringBuilderSync throws IndexException |
Inserts a signed integer. |
| public | insertinsert(position as Long, value as Long) as StringBuilderSync throws IndexException |
Inserts a signed long. |
| public | insertinsert(position as Long, value as Object) as StringBuilderSync throws IndexException |
Inserts the string representation of an object. |
| public | insertinsert(position as Long, value as SByte) as StringBuilderSync throws IndexException |
Inserts a signed byte. |
| public | insertinsert(position as Long, value as Short) as StringBuilderSync throws IndexException |
Inserts a signed short. |
| public | insertinsert(position as Long, value as String) as StringBuilderSync throws IndexException |
Inserts a string at a given position. |
| public | insertinsert(position as Long, value as UInt) as StringBuilderSync throws IndexException |
Inserts an unsigned integer. |
| public | insertinsert(position as Long, value as ULong) as StringBuilderSync throws IndexException |
Inserts an unsigned long. |
| public | insertinsert(position as Long, value as UShort) as StringBuilderSync throws IndexException |
Inserts an unsigned short. |
| public | lengthlength() as ULong |
Returns current content length. |
| public | removeremove(position as Long, length as ULong) as StringBuilderSync throws IndexException |
Removes a range of characters. |
| public | reversereverse() as StringBuilderSync |
Reverses characters in place. |
| public | toCharArraytoCharArray() as Char[] |
Returns the content as Unicode scalar values. |
| public | toCodeUnitArraytoCodeUnitArray() as CodeUnit[] |
Returns the content as UTF-16 code units. |
| public override | toStringtoString() as String |
Returns a String representation of the builder content. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | operator[](position as Long) as Char throws IndexException | Gets or sets one Unicode scalar by index. |