# SortedMapLikeBinaryTreeNode

@Serializable
class SortedMapLikeBinaryTreeNode < K , V >(val key: K , val value: V , comparator: Comparator < K >) : Iterable < SortedMapLikeBinaryTreeNode < K , V >> (source)

## Constructors

SortedMapLikeBinaryTreeNode
Link copied to clipboard
constructor(key: K , value: V , comparator: Comparator < K >)

## Types

Companion
Link copied to clipboard
object Companion

## Properties

key
Link copied to clipboard
val key : K
value
Link copied to clipboard
val value : V

## Functions

awaitFirst
Link copied to clipboard
suspend fun < T > Iterable <Deferred< T >>. awaitFirst (cancelOthers: Boolean = true): T

Trying to Deferred.await on all thiss. The first Deferred completed its work will interrupt all others awaits and, if cancelOthers passed as true (by default), will also cancel all the others Deferreds

suspend fun < T > Iterable <Deferred< T >>. awaitFirst (scope: CoroutineScope, cancelOnResult: Boolean = true): T

Trying to Deferred.await on all thiss. The first Deferred completed its work will interrupt all others awaits and, if cancelOnResult passed as true (by default), will also cancel all the others Deferreds

awaitFirstWithDeferred
Link copied to clipboard
suspend fun < T > Iterable <Deferred< T >>. awaitFirstWithDeferred (scope: CoroutineScope, cancelOnResult: Boolean = true): Pair <Deferred< T >, T >

Trying to Deferred.await on all thiss. The first Deferred completed its work will interrupt all others awaits and, if cancelOnResult passed as true (by default), will also cancel all the others Deferreds

calculateDiff
Link copied to clipboard
fun < T > Iterable < T >. calculateDiff (other: Iterable < T >, strictComparison: Boolean = false): Diff < T >
fun < T > Iterable < T >. calculateDiff (other: Iterable < T >, comparisonFun: ( T ?, T ?) -> Boolean ): Diff < T >

Calculating Diff object

calculateStrictDiff
Link copied to clipboard
inline fun < T > Iterable < T >. calculateStrictDiff (other: Iterable < T >): Diff < T >

This method call calculateDiff with strict mode enabled

contains
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. contains (data: K ): Boolean
deepEquals
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. deepEquals (other: SortedMapLikeBinaryTreeNode < K , V >): Boolean
diff
Link copied to clipboard
inline fun < T > Iterable < T >. diff (other: Iterable < T >, strictComparison: Boolean = false): Diff < T >
inline fun < T > Iterable < T >. diff (other: Iterable < T >, noinline comparisonFun: ( T ?, T ?) -> Boolean ): Diff < T >
equals
Link copied to clipboard
open operator override fun equals (other: Any ?): Boolean
findNode
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. findNode (key: K ): SortedMapLikeBinaryTreeNode < K , V >?
findNodesInRange
Link copied to clipboard
suspend fun < K : Comparable < K >, V > SortedMapLikeBinaryTreeNode < K , V >. findNodesInRange (range: ClosedRange < K >): Set < SortedMapLikeBinaryTreeNode < K , V >>
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. findNodesInRange (from: K , to: K ): Set < SortedMapLikeBinaryTreeNode < K , V >>
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. findNodesInRange (from: K , to: K , fromInclusiveMode: Boolean , toInclusiveMode: Boolean ): Set < SortedMapLikeBinaryTreeNode < K , V >>
findNodesInRangeExcluding
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. findNodesInRangeExcluding (from: K , to: K ): Set < SortedMapLikeBinaryTreeNode < K , V >>
findParentNode
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. findParentNode (data: K ): SortedMapLikeBinaryTreeNode < K , V >?
firstNotNull
Link copied to clipboard
fun < T > Iterable < T ?>. firstNotNull (): T & Any

Returns the first non-null element in this iterable.

getLeftKey
Link copied to clipboard
suspend fun getLeftKey (): K ?
getLeftNode
Link copied to clipboard
suspend fun getLeftNode (): SortedMapLikeBinaryTreeNode < K , V >?
getLeftValue
Link copied to clipboard
suspend fun getLeftValue (): V ?
getRightKey
Link copied to clipboard
suspend fun getRightKey (): V ?
getRightNode
Link copied to clipboard
suspend fun getRightNode (): SortedMapLikeBinaryTreeNode < K , V >?
getRightValue
Link copied to clipboard
suspend fun getRightValue (): V ?
hashCode
Link copied to clipboard
open override fun hashCode (): Int
invokeFirstOf
Link copied to clipboard
suspend fun < O > Iterable < DeferredAction <*, O >>. invokeFirstOf (scope: CoroutineScope, cancelOnResult: Boolean = true): O

Invokes the first DeferredAction whose deferred value completes, executing its callback and returning the result. Other deferred actions are cancelled if cancelOnResult is true.

invokeOnFirst
Link copied to clipboard
suspend fun < T , O > Iterable <Deferred< T >>. invokeOnFirst (scope: CoroutineScope, cancelOnResult: Boolean = true, callback: suspend ( T ) -> O ): O

Awaits the first Deferred to complete and invokes the callback on its value. Other deferred values are cancelled if cancelOnResult is true.

iterator
Link copied to clipboard
open operator override fun iterator (): Iterator < SortedMapLikeBinaryTreeNode < K , V >>

This Iterator will run from less to greater values of nodes starting the dev.inmo.micro_utils.coroutines.collections.SortedMapLikeBinaryTreeNode-receiver. Due to non-suspending nature of iterator builder, this Iterator DO NOT guarantee consistent content due to iterations. It means, that tree can be changed during to iteration process

joinFirst
Link copied to clipboard
suspend fun Iterable <Job>. joinFirst (cancelOthers: Boolean = true): Job
suspend fun Iterable <Job>. joinFirst (scope: CoroutineScope, cancelOthers: Boolean = true): Job

Trying to Job.join on all thiss. The first Job completed its work will interrupt all others joins and, if cancelOthers passed as true (by default), will also cancel all the others Jobs

joinTo
Link copied to clipboard
inline fun < I > Iterable < I >. joinTo (separator: I ? = null, prefix: I ? = null, postfix: I ? = null): List < I >

Joins elements of this iterable into a list with a constant separator between elements. Optional prefix and postfix can be added to the result. Null separators are skipped.

inline fun < I > Iterable < I >. joinTo (separatorFun: ( I ) -> I ?, prefix: I ? = null, postfix: I ? = null): List < I >

Joins elements of this iterable into a list with separators between elements. Separators are generated using separatorFun. Optional prefix and postfix can be added to the result. Null values from separator function are skipped.

inline fun < I , R > Iterable < I >. joinTo (separator: R ? = null, prefix: R ? = null, postfix: R ? = null, transform: ( I ) -> R ?): List < R >

Joins elements of this iterable into a list with a constant separator between elements. Each element is transformed using transform. Optional prefix and postfix can be added to the result. Null values from transformations or separators are skipped.

inline fun < I , R > Iterable < I >. joinTo (separatorFun: ( I ) -> R ?, prefix: R ? = null, postfix: R ? = null, transform: ( I ) -> R ?): List < R >

Joins elements of this iterable into a list with separators between elements. Each element is transformed using transform, and separators are generated using separatorFun. Optional prefix and postfix can be added to the result. Null values from transformations or separator function are skipped.

mapNotNullA
Link copied to clipboard
inline fun < T , R > Iterable < T >. mapNotNullA (transform: ( T ) -> R ?): List < R >
optionallyReverse
Link copied to clipboard
fun < T > Iterable < T >. optionallyReverse (reverse: Boolean ): Iterable < T >

Optionally reverses this Iterable based on the reverse parameter. Delegates to specialized implementations for List and Set for better performance.

paginate
Link copied to clipboard
fun < T > Iterable < T >. paginate (with: Pagination ): PaginationResult < T >

Paginates this Iterable according to the given Pagination parameters. Returns a PaginationResult containing the items within the specified page range.

removeSubNode
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. removeSubNode (data: K ): Pair < SortedMapLikeBinaryTreeNode < K , V >, SortedMapLikeBinaryTreeNode < K , V >>?

Will remove (detach) node from tree starting with this

size
Link copied to clipboard
suspend fun size (): Int
toString
Link copied to clipboard
open override fun toString (): String
upsertSubNode
Link copied to clipboard
suspend fun < K , V > SortedMapLikeBinaryTreeNode < K , V >. upsertSubNode (key: K , value: V ): SortedMapLikeBinaryTreeNode < K , V >

Will add subnode in tree if there are no any node with key

withReplaced
Link copied to clipboard
fun < T > Iterable < T >. withReplaced (t: T , block: ( T ) -> T ): List < T >

Returns a new list with the first occurrence of element t replaced by applying block to it. All other elements remain unchanged.

withReplacedAt
Link copied to clipboard
fun < T > Iterable < T >. withReplacedAt (i: Int , block: ( T ) -> T ): List < T >

Returns a new list with the element at index i replaced by applying block to it. All other elements remain unchanged.