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

SubcomposeSlotReusePolicy.SlotIdsSet

public final class SubcomposeSlotReusePolicy.SlotIdsSet implements Collection


Set containing slot ids currently available to reuse. Used by getSlotsToRetain.

This class works exactly as MutableSet, but doesn't allow to add new items in it.

Summary

Public methods

final void

Removes all slot ids from this set.

@NonNull Iterator<Object>
final boolean
remove(Object slotId)

Removes a slotId from this set, if it is present.

final boolean
removeAll(@NonNull Function1<Object, @NonNull Boolean> predicate)

Removes all slot ids that match the given predicate.

final boolean

Removes all slot ids from slotIds that are also contained in this set.

final boolean
retainAll(@NonNull Function1<Object, @NonNull Boolean> predicate)

Retains only slotIds that match the given predicate.

final boolean

Retains only the slot ids that are contained in slotIds.

Inherited methods

From kotlin.collections.Collection
boolean
contains(Object element)
boolean
int
boolean

Public methods

clear

public final void clear()

Removes all slot ids from this set.

iterator

public @NonNull Iterator<Objectiterator()

remove

public final boolean remove(Object slotId)

Removes a slotId from this set, if it is present.

Returns
boolean

true if the slot id was removed, false if the set was not modified.

removeAll

public final boolean removeAll(@NonNull Function1<Object, @NonNull Boolean> predicate)

Removes all slot ids that match the given predicate.

Returns
boolean

true if any slot id was removed, false if the set was not modified.

removeAll

public final boolean removeAll(@NonNull Collection<Object> slotIds)

Removes all slot ids from slotIds that are also contained in this set.

Returns
boolean

true if any slot id was removed, false if the set was not modified.

retainAll

public final boolean retainAll(@NonNull Function1<Object, @NonNull Boolean> predicate)

Retains only slotIds that match the given predicate.

Returns
boolean

true if any slot id was removed, false if the set was not modified.

retainAll

public final boolean retainAll(@NonNull Collection<Object> slotIds)

Retains only the slot ids that are contained in slotIds.

Returns
boolean

true if any slot id was removed, false if the set was not modified.