SlotWriter
class SlotWriter : SlotEditor
kotlin.Any | ||
↳ | androidx.compose.SlotEditor | |
↳ | androidx.compose.SlotWriter |
Summary
Public methods |
|
---|---|
Anchor |
Allocate an anchor for a location. |
Unit |
Begin inserting at the current location. |
Unit |
close() |
Int |
endGroup() End the current group. |
Unit |
Ends inserting. |
Int |
endNode() End a node |
Iterator<Any?> |
Returns an iterator for the slots of group. |
Unit |
Move the offset'th group after the current group to the current location. |
Unit |
previous() Backup one slot. |
Boolean |
Remove a group. |
Unit |
Set the value at the current slot. |
Any? |
skip() Skip the current slot without updating |
Int |
Skip a group. |
Int |
skipNode() Skip a node |
Unit |
startGroup(key: Any) Start a group. |
Unit |
Start a node. |
String |
toString() |
Any? |
Set the value of the next slot. |
Inherited functions |
|
---|---|
Inherited properties |
|
---|---|
Public methods
anchor
fun anchor(index: Int = current): Anchor
Allocate an anchor for a location. As content is inserted and removed from the slot table the anchor is updated to reflect those changes. For example, if an anchor is requested for an group, the anchor will report the location of that group even if the group is moved in the slot table. If the position referenced by the anchor is removed, the anchor location is set to -1.
beginInsert
fun beginInsert(): Unit
Begin inserting at the current location. beginInsert() can be nested and must be called with a balanced number of endInsert()
close
fun close(): Unit
endGroup
fun endGroup(): Int
End the current group. Must be called after the corresponding startGroup().
moveGroup
fun moveGroup(offset: Int): Unit
Move the offset'th group after the current group to the current location.
previous
fun previous(): Unit
Backup one slot. For example, we ran into a key of a keyed group we don't want, this backs up current to be before the key.
startGroup
fun startGroup(key: Any): Unit
Start a group.
Parameters | |
---|---|
key: Any | The group key. Passing EMPTY will retain as was written last time. An EMPTY key is not valid when inserting groups. |
toString
fun toString(): String