SubcomposeSlotReusePolicy.SlotIdsSet


Set containing slot ids currently available to reuse. Used by getSlotsToRetain. The set retains the insertion order of its elements, guaranteeing stable iteration order.

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

Summary

Public functions

Unit

Removes all slot ids from this set.

Cmn
open operator Boolean
contains(element: Any?)
Cmn
open Boolean
containsAll(elements: Collection<Any?>)
Cmn
Unit
forEach(block: (Any?) -> Unit)

Iterates over every element stored in this set by invoking the specified block lambda.

Cmn
open Boolean
Cmn
open operator MutableIterator<Any?>
Cmn
Boolean
remove(slotId: Any?)

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

Cmn
Boolean
removeAll(predicate: (Any?) -> Boolean)

Removes all slot ids that match the given predicate.

Cmn
Boolean
removeAll(slotIds: Collection<Any?>)

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

Cmn
Boolean
retainAll(predicate: (Any?) -> Boolean)

Retains only slotIds that match the given predicate.

Cmn
Boolean
retainAll(slotIds: Collection<Any?>)

Retains only the slot ids that are contained in slotIds.

Cmn
Unit
trimToSize(maxSlotsToRetainForReuse: Int)

Remove entries until size equals maxSlotsToRetainForReuse.

Cmn

Public properties

open Int
Cmn

Public functions

clear

fun clear(): Unit

Removes all slot ids from this set.

contains

open operator fun contains(element: Any?): Boolean

containsAll

open fun containsAll(elements: Collection<Any?>): Boolean

forEach

fun forEach(block: (Any?) -> Unit): Unit

Iterates over every element stored in this set by invoking the specified block lambda. The iteration order is the same as the insertion order. It is safe to remove the element passed to block during iteration.

isEmpty

open fun isEmpty(): Boolean

iterator

open operator fun iterator(): MutableIterator<Any?>

remove

fun remove(slotId: Any?): Boolean

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

fun removeAll(predicate: (Any?) -> Boolean): Boolean

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

fun removeAll(slotIds: Collection<Any?>): Boolean

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

fun retainAll(predicate: (Any?) -> Boolean): Boolean

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

fun retainAll(slotIds: Collection<Any?>): Boolean

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.

trimToSize

fun trimToSize(maxSlotsToRetainForReuse: Int): Unit

Remove entries until size equals maxSlotsToRetainForReuse. Entries inserted last are removed first.

Public properties

size

open val sizeInt