{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

CompositionGroup

public interface CompositionGroup extends CompositionData


CompositionGroup is a group of data slots tracked independently by composition. These groups correspond to flow control branches (such as if statements and function calls) as well as emitting of a node to the tree.

This interface is not intended to be used directly and is provided to allow the tools API to have access to data tracked during composition. The tools API should be used instead which provides a more usable interpretation of the slot table.

Summary

Public methods

abstract @NonNull Iterable<Object>

The data stored in the slot table for this group.

default int

The total number of groups, including itself, that this group contains.

default Object

A value that identifies a Group independently of movement caused by recompositions.

abstract @NonNull Object

A value used to identify the group within its siblings and is typically a compiler generated integer but can be an object if the key composable is used.

abstract Object

If the group represents a node this returns a non-null value which is the node that was emitted for the group.

default int
abstract String

Information recorded by the compiler to help tooling identify the source that generated the group.

Inherited methods

From androidx.compose.runtime.tooling.CompositionData
default CompositionGroup
find(@NonNull Object identityToFind)

Find a sub-group by identity.

abstract @NonNull Iterable<@NonNull CompositionGroup>

Iterate the composition data in the group.

abstract boolean

Returns true if no composition data has been collected.

Public methods

getData

abstract @NonNull Iterable<ObjectgetData()

The data stored in the slot table for this group. This information includes the values stored for parameters that are checked for change, any value passed as a parameter for androidx.compose.runtime.remember and the last value returned by androidx.compose.runtime.remember, etc.

getGroupSize

default int getGroupSize()

The total number of groups, including itself, that this group contains.

getIdentity

default Object getIdentity()

A value that identifies a Group independently of movement caused by recompositions.

getKey

abstract @NonNull Object getKey()

A value used to identify the group within its siblings and is typically a compiler generated integer but can be an object if the key composable is used.

getNode

abstract Object getNode()

If the group represents a node this returns a non-null value which is the node that was emitted for the group.

getSlotsSize

default int getSlotsSize()

getSourceInfo

abstract String getSourceInfo()

Information recorded by the compiler to help tooling identify the source that generated the group. The format of this string is internal and is interpreted by the tools API which translates this information into source file name and offsets.