# SortedBinaryTreeNode

@Serializable
class SortedBinaryTreeNode < T >(val data: T , comparator: Comparator < T >) : Iterable < SortedBinaryTreeNode < T >> (source)

## Constructors

SortedBinaryTreeNode
Link copied to clipboard
constructor(data: T , comparator: Comparator < T >)

## Types

Companion
Link copied to clipboard
object Companion

## Properties

data
Link copied to clipboard
val data : T

## Functions

addSubNode
Link copied to clipboard
suspend fun < T > SortedBinaryTreeNode < T >. addSubNode (newData: T ): SortedBinaryTreeNode < T >

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

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 < T > SortedBinaryTreeNode < T >. contains (data: T ): 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 < T > SortedBinaryTreeNode < T >. findNode (data: T ): SortedBinaryTreeNode < T >?
findNodesInRange
Link copied to clipboard
suspend fun < T : Comparable < T >> SortedBinaryTreeNode < T >. findNodesInRange (range: ClosedRange < T >): Set < SortedBinaryTreeNode < T >>
suspend fun < T > SortedBinaryTreeNode < T >. findNodesInRange (from: T , to: T ): Set < SortedBinaryTreeNode < T >>
suspend fun < T > SortedBinaryTreeNode < T >. findNodesInRange (from: T , to: T , fromInclusiveMode: Boolean , toInclusiveMode: Boolean ): Set < SortedBinaryTreeNode < T >>
findNodesInRangeExcluding
Link copied to clipboard
suspend fun < T > SortedBinaryTreeNode < T >. findNodesInRangeExcluding (from: T , to: T ): Set < SortedBinaryTreeNode < T >>
findParentNode
Link copied to clipboard
suspend fun < T > SortedBinaryTreeNode < T >. findParentNode (data: T ): SortedBinaryTreeNode < T >?
firstNotNull
Link copied to clipboard
fun < T > Iterable < T ?>. firstNotNull (): <Error class: unknown class>
getLeft
Link copied to clipboard
suspend fun getLeft (): T ?
getLeftNode
Link copied to clipboard
suspend fun getLeftNode (): SortedBinaryTreeNode < T >?
getRight
Link copied to clipboard
suspend fun getRight (): T ?
getRightNode
Link copied to clipboard
suspend fun getRightNode (): SortedBinaryTreeNode < T >?
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
invokeOnFirst
Link copied to clipboard
suspend fun < T , O > Iterable <Deferred< T >>. invokeOnFirst (scope: CoroutineScope, cancelOnResult: Boolean = true, callback: suspend ( T ) -> O ): O
iterator
Link copied to clipboard
open operator override fun iterator (): Iterator < SortedBinaryTreeNode < T >>

This Iterator will run from less to greater values of nodes starting the dev.inmo.micro_utils.coroutines.collections.SortedBinaryTreeNode-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 >
inline fun < I > Iterable < I >. joinTo (separatorFun: ( I ) -> I ?, prefix: I ? = null, postfix: I ? = null): List < I >
inline fun < I , R > Iterable < I >. joinTo (separator: R ? = null, prefix: R ? = null, postfix: R ? = null, transform: ( I ) -> R ?): List < R >
inline fun < I , R > Iterable < I >. joinTo (separatorFun: ( I ) -> R ?, prefix: R ? = null, postfix: R ? = null, transform: ( I ) -> R ?): List < R >
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 >
paginate
Link copied to clipboard
fun < T > Iterable < T >. paginate (with: Pagination ): PaginationResult < T >
removeSubNode
Link copied to clipboard
suspend fun < T > SortedBinaryTreeNode < T >. removeSubNode (data: T ): Pair < SortedBinaryTreeNode < T >, SortedBinaryTreeNode < T >>?

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
withReplaced
Link copied to clipboard
fun < T > Iterable < T >. withReplaced (t: T , block: ( T ) -> T ): List < T >
withReplacedAt
Link copied to clipboard
fun < T > Iterable < T >. withReplacedAt (i: Int , block: ( T ) -> T ): List < T >