GroupWithLeader

interface GroupWithLeader<T, N : Node<T>> : Group<T>

A group that designates a special member as the leader.

Type Parameters

T

the concentration type.

N

the concrete node type used for the leader.

Inheritors

Properties

Link copied to clipboard
abstract val leader: N

The node acting as the group's leader.

Link copied to clipboard
open val members: List<Node<T>>

The list of nodes that belong to this group.

Link copied to clipboard
abstract override val size: Int

Functions

Link copied to clipboard
abstract override fun add(element: Node<T>): Boolean
abstract fun add(index: Int, element: Node<T>)
Link copied to clipboard
abstract override fun addAll(elements: Collection<Node<T>>): Boolean
abstract fun addAll(index: Int, elements: Collection<Node<T>>): Boolean
Link copied to clipboard
abstract override fun clear()
Link copied to clipboard
fun <T, O> List<Observable<T>>.combineLatest(collector: (List<T>) -> O): Observable<Option<O>>

Collects the latest values emitted by a list of Observables and transforms them into a new Observable using the provided collector function.

Link copied to clipboard
abstract operator override fun contains(element: Node<T>): Boolean
Link copied to clipboard
abstract override fun containsAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard

Given a non-empty list of points represented as vectors, this method finds the extreme coordinates (i.e. min and max coordinates) on the X-axis, these are used to create the returned ClosedRange.

Link copied to clipboard

Given a non-empty list of points represented as vectors, this method finds the extreme coordinates (i.e. min and max coordinates) on the Y-axis, these are used to create the returned ClosedRange.

Link copied to clipboard
abstract operator fun get(index: Int): Node<T>
Link copied to clipboard
abstract fun indexOf(element: Node<T>): Int
Link copied to clipboard
abstract override fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): MutableIterator<Node<T>>
Link copied to clipboard
abstract fun lastIndexOf(element: Node<T>): Int
Link copied to clipboard
abstract override fun listIterator(): MutableListIterator<Node<T>>
abstract override fun listIterator(index: Int): MutableListIterator<Node<T>>
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
abstract override fun remove(element: Node<T>): Boolean
Link copied to clipboard
abstract override fun removeAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard
abstract fun removeAt(index: Int): Node<T>
Link copied to clipboard
abstract override fun retainAll(elements: Collection<Node<T>>): Boolean
Link copied to clipboard
abstract operator fun set(index: Int, element: Node<T>): Node<T>
Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

Link copied to clipboard
abstract override fun subList(fromIndex: Int, toIndex: Int): MutableList<Node<T>>
Link copied to clipboard
fun <T> List<T>.takeFraction(percentage: Double): List<T>

Takes the first percentage * size elements of the list.

Link copied to clipboard

Converts the current list into an observable mutable list.

Link copied to clipboard

Converts the current list into an observable mutable set.