filterWindowedEnclosing

fun <T> List<T>.filterWindowedEnclosing(windowSize: Int, predicate: (List<T>) -> Boolean): List<T>

Filters out all elements, when the predicate with windowSize is matching.

Receiver

list on which the window filter is applied

Return

list without elements which match the predicate

Parameters

windowSize

size of the window

predicate

if the predicate returns true, all elements are filtered out


fun <T> List<T>.filterWindowedEnclosing(dropIndices: List<Boolean>, predicate: (List<T>) -> Boolean): List<T>

Filter windows that follow which match the predicate. The filter window is executed enclosing the list.

Example Given a list: A, A, B, C, A Predicate: it0 == it1 DropIndices: (true, false) -> A, B, C (edge pattern also dropped) DropIndices: (false, true) -> A, B, C, A (edge pattern not dropped)

Receiver

list on which the window filter is applied

Return

list without elements which match the predicate

Parameters

dropIndices

the list of Boolean indicating the the indices that are dropped in the case of a matching predicate

predicate

if the predicate returns true, the indices are dropped according to the dropIndices