Skip to main content
Module

x/rimbu/mod.ts>SortedSet.Builder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface SortedSet.Builder
implements [RSetBase.Builder]<T, SortedSet.Types>
import { type SortedSet } from "https://deno.land/x/rimbu@0.14.0/mod.ts";
const { Builder } = SortedSet;

A mutable SortedSet builder used to efficiently create new immutable instances. See the Set documentation and the SortedSet.Builder API documentation

Methods

min(): T | undefined

Returns the minimum value of the SortedSet builder, or a fallback value (default: undefined) if the builder is empty.

min<O>(otherwise: OptLazy<O>): T | O
max(): T | undefined

Returns the maximum value of the SortedSet builder, or a fallback value (default: undefined) if the builder is empty.

max<O>(otherwise: OptLazy<O>): T | O
getAtIndex(index: number): T | undefined

Returns the value at the given index of the value sort order of the SortedSet builder, or a fallback value (default: undefined) if the index is out of bounds.

getAtIndex<O>(index: number, otherwise: OptLazy<O>): T | O