Collapse

sealed interface Collapse<out E>

A collapsing view over a collection of size elements that can be accessed as a list, set, or sequence.

This abstraction is used to represent either the neighborhood of a field (peers), or the neighborhood plus the local element (with self), with different subtypes conveying inclusion semantics.

Type Parameters

E

the element type contained in the collapse.

Inheritors

Properties

Link copied to clipboard
abstract val list: List<E>
Link copied to clipboard
abstract val sequence: Sequence<E>
Link copied to clipboard
abstract val set: Set<E>
Link copied to clipboard
abstract val size: Int

Functions

Link copied to clipboard
operator fun <T> Collapse<T>.contains(element: T): Boolean

Checks if the given element is present in this collapse.

Link copied to clipboard
fun <ID : Any, T> Collapse<FieldEntry<ID, T>>.toMap(): Map<ID, T>

Converts this collapse of field entries into a map from entry IDs to their values.