IViewableSet

interface IViewableSet<T : Any> : Set<T> , IViewable<T> , ISource<IViewableSet.Event<T>>

A set allowing its contents to be observed.

Types

Link copied to clipboard
data class Event<T>(val kind: AddRemove, val value: T)

Represents an addition or removal of an element in the set.

Functions

Link copied to clipboard
abstract fun advise(lifetime: Lifetime, handler: (IViewableSet.Event<T>) -> Unit)

Adds an event subscription. Every time an event occurs, the handler is called, receiving an instance of the event. The subscription is removed when the given lifetime expires.

open fun advise(lifetime: Lifetime, handler: (AddRemove, T) -> Unit)

Adds a subscription for additions and removals of set elements. When the subscription is initially added, handler is called with AddRemove.Add events for all elements currently in the set.

Link copied to clipboard
abstract operator override fun contains(element: T): Boolean
Link copied to clipboard
abstract override fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
open fun forEach(p0: Consumer<in T>)
Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<T>
Link copied to clipboard
open fun parallelStream(): Stream<T>
Link copied to clipboard
open override fun spliterator(): Spliterator<T>
Link copied to clipboard
open fun stream(): Stream<T>
Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
open override fun view(lifetime: Lifetime, handler: (Lifetime, T) -> Unit)

Adds a subscription to changes of the contents of the set.

Properties

Link copied to clipboard
abstract val change: ISource<IViewableSet.Event<T>>
Link copied to clipboard
abstract override val size: Int

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun <T : Any> IViewableSet<T>.createIsEmpty(lifetime: Lifetime): IPropertyView<Boolean>
fun <T : Any> IViewableSet<T>.createIsEmpty(): IPropertyView<Boolean>
Link copied to clipboard
fun <T : Any> IViewableSet<T>.createIsNotEmpty(lifetime: Lifetime): IPropertyView<Boolean>
fun <T : Any> IViewableSet<T>.createIsNotEmpty(): IPropertyView<Boolean>