Core LibraryAPI Reference

Choose documentation 1

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

function libtmux-kotlin latest

filter

Package io.github.libtmux.kotlin.Iterable.filter io.github.libtmux.kotlin.Iterable

Selects the elements an expression matches.

View as Markdown

Source and package
Module
io.github.libtmux.kotlin.Iterable
Package
io.github.libtmux:libtmux-kotlin
Source
libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Filters.kt
public fun <T : Any> Iterable<T>.filter(expression: FilterExpr<T>): List<T>public fun Iterable<Session>.filter(expression: FilterExpr<JavaSession>): List<Session>public fun Iterable<Window>.filter(expression: FilterExpr<JavaWindow>): List<Window>public fun Iterable<Pane>.filter(expression: FilterExpr<JavaPane>): List<Pane>public fun Iterable<Client>.filter(expression: FilterExpr<JavaClient>): List<Client>
functionoverload5 overloads [source]

Description#

Kotlin's own filter takes a function, not a java.util.function.Predicate , so handing it a FilterExpr does not compile — the one place where reading the Java documentation and writing Kotlin part company. This is that overload, so panes.filter(Pane_.active().isTrue()) means what it appears to.

The list is already in hand: this asks tmux nothing.

Parameters
Esc

Type to search.