StringBuilderSync
class in package klyn

    public class StringBuilderSync extends Object:

Object
└ StringBuilderSync

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`:

- UTF-8 text
- `size` and `length()` count Unicode scalar values, not UTF-8 bytes
- AZT (ASCII zero terminated) strings
- `Char(0)` is reserved as the end-of-string marker

Use it for shared textual logs, prompts or generated source fragments. It must not be used as a binary container.

Example

    builder = StringBuilderSync()
    builder.append("worker:")
    builder.append(" 1")
    print(builder.toString())

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | isEmpty `isEmpty as Boolean:` | Returns true when no character is present.
public readonly property | size `size as UInt:` | Returns the number of characters in the string builder.

Inherited Properties
property Inherited Properties from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | StringBuilderSync `StringBuilderSync(size as UInt = 256):` | Creates a new synchronized builder.
public | StringBuilderSync `StringBuilderSync(value as String):` | Creates a new synchronized builder initialized with text.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | append `append(char as Char) as StringBuilderSync:` | Appends one character to the builder.
public | append `append(value as Boolean) as StringBuilderSync:` | Appends a boolean.
public | append `append(value as Byte) as StringBuilderSync:` | Appends an unsigned byte.
public | append `append(value as Double) as StringBuilderSync:` | Appends a double.
public | append `append(value as Float) as StringBuilderSync:` | Appends a float.
public | append `append(value as Int) as StringBuilderSync:` | Appends a signed integer.
public | append `append(value as Long) as StringBuilderSync:` | Appends a signed long.
public | append `append(value as Object) as StringBuilderSync:` | Appends the string representation of an object.
public | append `append(value as SByte) as StringBuilderSync:` | Appends a signed byte.
public | append `append(value as Short) as StringBuilderSync:` | Appends a signed short.
public | append `append(value as String) as StringBuilderSync:` | Appends a string.
public | append `append(value as UInt) as StringBuilderSync:` | Appends an unsigned integer.
public | append `append(value as ULong) as StringBuilderSync:` | Appends an unsigned long.
public | append `append(value as UShort) as StringBuilderSync:` | Appends an unsigned short.
public | clear `clear() as StringBuilderSync:` | Clears current content.
public | insert `insert(position as UInt, char as Char) as StringBuilderSync throws IndexException:` | Inserts one character.
public | insert `insert(position as UInt, value as Boolean) as StringBuilderSync throws IndexException:` | Inserts a boolean.
public | insert `insert(position as UInt, value as Byte) as StringBuilderSync throws IndexException:` | Inserts an unsigned byte.
public | insert `insert(position as UInt, value as Double) as StringBuilderSync throws IndexException:` | Inserts a double.
public | insert `insert(position as UInt, value as Float) as StringBuilderSync throws IndexException:` | Inserts a float.
public | insert `insert(position as UInt, value as Int) as StringBuilderSync throws IndexException:` | Inserts a signed integer.
public | insert `insert(position as UInt, value as Long) as StringBuilderSync throws IndexException:` | Inserts a signed long.
public | insert `insert(position as UInt, value as Object) as StringBuilderSync throws IndexException:` | Inserts the string representation of an object.
public | insert `insert(position as UInt, value as SByte) as StringBuilderSync throws IndexException:` | Inserts a signed byte.
public | insert `insert(position as UInt, value as Short) as StringBuilderSync throws IndexException:` | Inserts a signed short.
public | insert `insert(position as UInt, value as String) as StringBuilderSync throws IndexException:` | Inserts a string at a given position.
public | insert `insert(position as UInt, value as UInt) as StringBuilderSync throws IndexException:` | Inserts an unsigned integer.
public | insert `insert(position as UInt, value as ULong) as StringBuilderSync throws IndexException:` | Inserts an unsigned long.
public | insert `insert(position as UInt, value as UShort) as StringBuilderSync throws IndexException:` | Inserts an unsigned short.
public | length `length() as UInt:` | Returns current content length.
public | remove `remove(position as UInt, length as UInt) as StringBuilderSync throws IndexException:` | Removes a range of characters.
public | reverse `reverse() as StringBuilderSync:` | Reverses characters in place.
public | toCharArray `toCharArray() as Char[]:` | Returns the content as a character array.
public override | toString `toString() as String:` | Returns a String representation of the builder content.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml
Operators

Modifier and Type | Member | Description
--- | --- | ---
public | operator[](position as UInt) as Char throws IndexException: | Gets or sets one character by index.