Package-level declarations

Types

Link copied to clipboard
typealias AbsoluteBoundsListener = (view: View, old: Rectangle, new: Rectangle) -> Unit

Created by Nicholas Eddy on 12/26/18.

Link copied to clipboard
enum Anchor : Enum<Anchor>

Created by Nicholas Eddy on 4/25/19.

Link copied to clipboard

Created by Nicholas Eddy on 4/2/18.

Link copied to clipboard
class BreadthFirstTreeIterator<out T>(root: Node<T>) : Iterator<T>

Iterator that traverses the nodes of a tree in breadth-first order.

Link copied to clipboard
interface Cancelable
Link copied to clipboard
typealias ChangeObserver<S> = (source: S) -> Unit

Handler for arbitrary changes to some source.

Link copied to clipboard
Link copied to clipboard

ChangeObservers implemented using a SetPool.

Link copied to clipboard

Defines an activity that can be completed at some point.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class FilteredList<E>(val source: ObservableList<E>, filter: (E) -> Boolean? = null) : ObservableList<E>

Provides a filtered view of an underlying ObservableList. Changes to this list affect the underlying list, but their effects may not be visible once applied due to filter.

Link copied to clipboard
Link copied to clipboard
class LeastRecentlyUsedCache<K, V>(maxSize: Int) : MutableMap<K, V>

Created by Nicholas Eddy on 3/22/20.

Link copied to clipboard
typealias ListObserver<S, T> = (source: S, changes: Differences<T>) -> Unit

Handler for arbitrary changes to some source.

Link copied to clipboard
typealias ListObservers<S, T> = Pool<ListObserver<S, T>>
Link copied to clipboard
class MatchedChunk(val match: String, val delimiter: String)
Link copied to clipboard
class MatchResult(val matches: List<MatchedChunk>, val remaining: String)
Link copied to clipboard
interface Matrix<out T : Number>

An NxM Matrix.

Link copied to clipboard
open class MatrixImpl<T : Number> : Matrix<T>

An (NxM) Matrix.

Link copied to clipboard
interface Node<T>

A node within a tree.

Link copied to clipboard
interface ObservableList<E> : MutableList<E>

A List that notifies observers of changes to its contents.

Link copied to clipboard
Link copied to clipboard
interface ObservablePool<T> : Pool<T>

A Pool that notifies of changes to its contents.

Link copied to clipboard
open class ObservableSet<E> : MutableSet<E>
Link copied to clipboard
expect open class ObservableSetPool<T>(delegate: SetPool<T>) : ObservablePool<T> , Set<T>

Implementation of ObservablePool based on a Set. Contents are stored in the provided delegate.

Link copied to clipboard

Created by Nicholas Eddy on 2/13/18.

Link copied to clipboard
class Path<T>(items: List<T>) : Iterable<T>

Created by Nicholas Eddy on 3/23/18.

Link copied to clipboard
interface Pausable : Completable

Defines an activity that can be paused and resumed.

Link copied to clipboard
Link copied to clipboard
interface Pool<in T>

A collection of items that only exposes add/remove semantics that is used for observers.

Link copied to clipboard
interface PoolObserver<T>

Observer of changes to ObservablePool.

Link copied to clipboard
typealias PropertyObserver<S, T> = (source: S, old: T, new: T) -> Unit

Handler for changes to some property of a source.

Link copied to clipboard
Link copied to clipboard

PropertyObservers implemented using a SetPool.

Link copied to clipboard
typealias RelativeBoundsListener = (view: View, relativeTo: View, old: Rectangle, new: Rectangle) -> Unit
Link copied to clipboard
Link copied to clipboard
class Resizer(view: View, manageCursor: Boolean = true, var movable: Boolean = true, during: Resizer.Phase = EventBubbling) : PointerListener, PointerMotionListener

Utility for resizing/moving a View. It supports compass direction resizing and dragging.

Link copied to clipboard
Link copied to clipboard
typealias SetObserver<S, T> = (source: S, removed: Set<T>, added: Set<T>) -> Unit

Handler for arbitrary changes to some source.

Link copied to clipboard
typealias SetObservers<S, T> = Pool<SetObserver<S, T>>
Link copied to clipboard
expect open class SetPool<T> : Pool<T> , Set<T>

Implementation of Pool based on a Set.

Link copied to clipboard
open class SquareMatrix<T : Number> : MatrixImpl<T>

A square (NxN) Matrix.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Inherited properties

Link copied to clipboard

Created by Nicholas Eddy on 10/20/17.

Link copied to clipboard
Link copied to clipboard

The span of a range: endInclusive - start

Functions

Link copied to clipboard
fun <V, T : Cancelable> autoCanceling(default: T? = null, onChanged: (old: T?, new: T?) -> Unit = { _,_ -> }): ReadWriteProperty<V, T?>

Creates a ReadWriteProperty that will cancel the previous value when changed.

Link copied to clipboard
fun <T : Units> lerp(first: Measure<T>, second: Measure<T>, fraction: Float): Measure<T>

Interpolates between two Measure.

fun lerp(first: Double, second: Double, fraction: Float): Double
fun lerp(first: Float, second: Float, fraction: Float): Float

Interpolates between two values.

Link copied to clipboard
@JvmName(name = "matrixOfD")
fun matrixOf(rows: Int, cols: Int, init: (row: Int, col: Int) -> Double): Matrix<Double>
@JvmName(name = "matrixOfF")
fun matrixOf(rows: Int, cols: Int, init: (row: Int, col: Int) -> Float): Matrix<Float>
@JvmName(name = "matrixOfI")
fun matrixOf(rows: Int, cols: Int, init: (row: Int, col: Int) -> Int): Matrix<Int>
@JvmName(name = "matrixOfL")
fun matrixOf(rows: Int, cols: Int, init: (row: Int, col: Int) -> Long): Matrix<Long>

Creates an NxM Matrix, where N == rows and M == cols.

Link copied to clipboard
fun <S, T> observable(initial: T, onChange: S.(old: T, new: T) -> Unit): ReadWriteProperty<S, T>
fun <S, T> observable(initial: T, observers: Iterable<PropertyObserver<S, T>>): ReadWriteProperty<S, T>
fun <S, T> observable(initial: T, observers: Iterable<PropertyObserver<S, T>>, onChange: (old: T, new: T) -> Unit): ReadWriteProperty<S, T>
Link copied to clipboard
@JvmName(name = "squareMatrixOfD")
fun squareMatrixOf(size: Int, init: (row: Int, col: Int) -> Double): SquareMatrix<Double>
@JvmName(name = "squareMatrixOfF")
fun squareMatrixOf(size: Int, init: (row: Int, col: Int) -> Float): SquareMatrix<Float>
@JvmName(name = "squareMatrixOfI")
fun squareMatrixOf(size: Int, init: (row: Int, col: Int) -> Int): SquareMatrix<Int>
@JvmName(name = "squareMatrixOfL")
fun squareMatrixOf(size: Int, init: (row: Int, col: Int) -> Long): SquareMatrix<Long>

Creates an NxN SquareMatrix, where N == size.

Inherited functions

Link copied to clipboard
fun <T> MutableList<T>.addOrAppend(at: Int, value: T)

Ads value to the list at the specify index, or at the end of the list if that index exceeds the current list length.

Link copied to clipboard
fun Collection<Completable>.allCompleted(completed: () -> Unit)
Link copied to clipboard
operator fun <E> Collection<E>?.contains(element: E): Boolean

Nullable helper

Link copied to clipboard
fun Boolean.ifFalse(block: () -> Unit): Boolean
Link copied to clipboard
fun <T> T?.ifNull(block: () -> Unit): T?
Link copied to clipboard
fun Boolean.ifTrue(block: () -> Unit): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T, V> Pool<T>.map(by: (V) -> T): Pool<V>

Creates a new Pool that is based on another of a different type.

@JvmName(name = "mapDD")
fun SquareMatrix<Double>.map(transform: (Double) -> Double): SquareMatrix<Double>
@JvmName(name = "mapDF")
fun SquareMatrix<Double>.map(transform: (Double) -> Float): SquareMatrix<Float>
@JvmName(name = "mapDI")
fun SquareMatrix<Double>.map(transform: (Double) -> Int): SquareMatrix<Int>
@JvmName(name = "mapDL")
fun SquareMatrix<Double>.map(transform: (Double) -> Long): SquareMatrix<Long>
@JvmName(name = "mapFD")
fun SquareMatrix<Float>.map(transform: (Float) -> Double): SquareMatrix<Double>
@JvmName(name = "mapFF")
fun SquareMatrix<Float>.map(transform: (Float) -> Float): SquareMatrix<Float>
@JvmName(name = "mapFI")
fun SquareMatrix<Float>.map(transform: (Float) -> Int): SquareMatrix<Int>
@JvmName(name = "mapFL")
fun SquareMatrix<Float>.map(transform: (Float) -> Long): SquareMatrix<Long>
@JvmName(name = "mapID")
fun SquareMatrix<Int>.map(transform: (Int) -> Double): SquareMatrix<Double>
@JvmName(name = "mapIF")
fun SquareMatrix<Int>.map(transform: (Int) -> Float): SquareMatrix<Float>
@JvmName(name = "mapIL")
fun SquareMatrix<Int>.map(transform: (Int) -> Long): SquareMatrix<Long>
@JvmName(name = "mapLD")
fun SquareMatrix<Long>.map(transform: (Long) -> Double): SquareMatrix<Double>
@JvmName(name = "mapLF")
fun SquareMatrix<Long>.map(transform: (Long) -> Float): SquareMatrix<Float>
@JvmName(name = "mapLI")
fun SquareMatrix<Long>.map(transform: (Long) -> Int): SquareMatrix<Int>
@JvmName(name = "mapLL")
fun SquareMatrix<Long>.map(transform: (Long) -> Long): SquareMatrix<Long>

@JvmName(name = "mapII")
fun SquareMatrix<Int>.map(transform: (Int) -> Int): SquareMatrix<Int>

Creates a new SquareMatrix whose members are the transform of those in this one.

Link copied to clipboard
@JvmName(name = "mapIndexedD")
fun SquareMatrix<Double>.mapIndexed(transform: (col: Int, row: Int, Double) -> Double): SquareMatrix<Double>
@JvmName(name = "mapIndexedF")
fun SquareMatrix<Float>.mapIndexed(transform: (col: Int, row: Int, Float) -> Float): SquareMatrix<Float>
@JvmName(name = "mapIndexedL")
fun SquareMatrix<Long>.mapIndexed(transform: (col: Int, row: Int, Long) -> Long): SquareMatrix<Long>

@JvmName(name = "mapIndexedI")
fun SquareMatrix<Int>.mapIndexed(transform: (col: Int, row: Int, Int) -> Int): SquareMatrix<Int>

Like map, but with col, row given for each item during tranformation.

Link copied to clipboard
Link copied to clipboard
operator fun Matrix<Double>.plus(other: Matrix<Double>): Matrix<Double>
Link copied to clipboard

Rounds this number to the nearest value.

Link copied to clipboard
fun <T> ObservableList<T>.sortWith(comparator: Comparator<in T>)
Link copied to clipboard
Link copied to clipboard
fun CharSequence.splitMatches(regex: Regex, limit: Int = 0): MatchResult

Splits the character sequence based on a regex into a set of MatchedChunks, which indicates the match and the delimiter that separates it from its neighbor on the right.

fun Regex.splitMatches(input: CharSequence, limit: Int = 0): MatchResult

Splits the given character sequence based on this regex into a set of MatchedChunks.

Link copied to clipboard
operator fun Matrix<Double>.times(other: Matrix<Double>): Matrix<Double>
@JvmName(name = "timesDD")
inline operator fun SquareMatrix<Double>.times(value: Double): SquareMatrix<Double>
@JvmName(name = "timesDF")
inline operator fun SquareMatrix<Double>.times(value: Float): SquareMatrix<Double>
@JvmName(name = "timesDI")
inline operator fun SquareMatrix<Double>.times(value: Int): SquareMatrix<Double>
@JvmName(name = "timesDL")
inline operator fun SquareMatrix<Double>.times(value: Long): SquareMatrix<Double>
@JvmName(name = "timesFD")
inline operator fun SquareMatrix<Float>.times(value: Double): SquareMatrix<Double>
@JvmName(name = "timesFF")
inline operator fun SquareMatrix<Float>.times(value: Float): SquareMatrix<Float>
@JvmName(name = "timesFI")
inline operator fun SquareMatrix<Float>.times(value: Int): SquareMatrix<Float>
@JvmName(name = "timesFL")
inline operator fun SquareMatrix<Float>.times(value: Long): SquareMatrix<Float>
@JvmName(name = "timesID")
inline operator fun SquareMatrix<Int>.times(value: Double): SquareMatrix<Double>
@JvmName(name = "timesIF")
inline operator fun SquareMatrix<Int>.times(value: Float): SquareMatrix<Float>
@JvmName(name = "timesIL")
inline operator fun SquareMatrix<Int>.times(value: Long): SquareMatrix<Long>
@JvmName(name = "timesLD")
inline operator fun SquareMatrix<Long>.times(value: Double): SquareMatrix<Double>
@JvmName(name = "timesLF")
inline operator fun SquareMatrix<Long>.times(value: Float): SquareMatrix<Float>
@JvmName(name = "timesLI")
inline operator fun SquareMatrix<Long>.times(value: Int): SquareMatrix<Long>
@JvmName(name = "timesLL")
inline operator fun SquareMatrix<Long>.times(value: Long): SquareMatrix<Long>
@JvmName(name = "timesDD")
operator fun Double.times(value: SquareMatrix<Double>): SquareMatrix<Double>
@JvmName(name = "timesDF")
operator fun Double.times(value: SquareMatrix<Float>): SquareMatrix<Double>
@JvmName(name = "timesDI")
operator fun Double.times(value: SquareMatrix<Int>): SquareMatrix<Double>
@JvmName(name = "timesDL")
operator fun Double.times(value: SquareMatrix<Long>): SquareMatrix<Double>
@JvmName(name = "timesFD")
operator fun Float.times(value: SquareMatrix<Double>): SquareMatrix<Double>
@JvmName(name = "timesFF")
operator fun Float.times(value: SquareMatrix<Float>): SquareMatrix<Float>
@JvmName(name = "timesFI")
operator fun Float.times(value: SquareMatrix<Int>): SquareMatrix<Float>
@JvmName(name = "timesFL")
operator fun Float.times(value: SquareMatrix<Long>): SquareMatrix<Float>
@JvmName(name = "timesID")
operator fun Int.times(value: SquareMatrix<Double>): SquareMatrix<Double>
@JvmName(name = "timesIF")
operator fun Int.times(value: SquareMatrix<Float>): SquareMatrix<Float>
@JvmName(name = "timesIL")
operator fun Int.times(value: SquareMatrix<Long>): SquareMatrix<Long>
@JvmName(name = "timesLD")
operator fun Long.times(value: SquareMatrix<Double>): SquareMatrix<Double>
@JvmName(name = "timesLF")
operator fun Long.times(value: SquareMatrix<Float>): SquareMatrix<Float>
@JvmName(name = "timesLI")
operator fun Long.times(value: SquareMatrix<Int>): SquareMatrix<Long>
@JvmName(name = "timesLL")
operator fun Long.times(value: SquareMatrix<Long>): SquareMatrix<Long>

@JvmName(name = "timesII")
inline operator fun SquareMatrix<Int>.times(value: Int): SquareMatrix<Int>
@JvmName(name = "timesII")
operator fun Int.times(value: SquareMatrix<Int>): SquareMatrix<Int>
Link copied to clipboard