SlotWriter

class SlotWriter : SlotEditor
kotlin.Any
   ↳ androidx.compose.SlotEditor
   ↳ androidx.compose.SlotWriter

Summary

Public methods

Anchor
anchor(index: Int = current)

Allocate an anchor for a location.

Unit

Begin inserting at the current location.

Unit

Int

End the current group.

Unit

Ends inserting.

Int

End a node

Iterator<Any?>

Returns an iterator for the slots of group.

Unit
moveGroup(offset: Int)

Move the offset'th group after the current group to the current location.

Unit

Backup one slot.

Boolean

Remove a group.

Unit
set(value: Any?)

Set the value at the current slot.

Any?

Skip the current slot without updating

Int

Skip a group.

Int

Skip a node

Unit

Start a group.

Unit
startNode(key: Any)

Start a node.

String

Any?
update(value: 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().

endInsert

fun endInsert(): Unit

Ends inserting.

endNode

fun endNode(): Int

End a node

groupSlots

fun groupSlots(): Iterator<Any?>

Returns an iterator for the slots of group.

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.

removeGroup

fun removeGroup(): Boolean

Remove a group. Must be called at group.

set

fun set(value: Any?): Unit

Set the value at the current slot.

skip

fun skip(): Any?

Skip the current slot without updating

skipGroup

fun skipGroup(): Int

Skip a group. Must be called at the start of a group.

skipNode

fun skipNode(): Int

Skip a node

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.

startNode

fun startNode(key: Any): Unit

Start a node.

toString

fun toString(): String

update

fun update(value: Any?): Any?

Set the value of the next slot.