Class RedBlackTreeExtensions

Defines some extensions against the RedBlackTree<TData> class

Inheritance
System.Object
RedBlackTreeExtensions
Namespace: Solti.Utils.Primitives
Assembly: Solti.Utils.Primitives.dll
Syntax
public static class RedBlackTreeExtensions : Object

Methods

Clone<TData>(RedBlackTree<TData>)

Clones the given tree.

Declaration
public static RedBlackTree<TData> Clone<TData>(this RedBlackTree<TData> src)
Parameters
Type Name Description
RedBlackTree<TData> src
Returns
Type Description
RedBlackTree<TData>
Type Parameters
Name Description
TData

CreateLookup<TKey, TValue>()

Creates a red-black tree intended for value lookup.

Declaration
public static RedBlackTree<KeyValuePair<TKey, TValue>> CreateLookup<TKey, TValue>()
    where TKey : IComparable<TKey>
Returns
Type Description
RedBlackTree<System.Collections.Generic.KeyValuePair<TKey, TValue>>
Type Parameters
Name Description
TKey
TValue

TryAdd<TKey, TValue>(RedBlackTree<KeyValuePair<TKey, TValue>>, TKey, TValue)

Tries to add a value to the lookup.

Declaration
public static bool TryAdd<TKey, TValue>(this RedBlackTree<KeyValuePair<TKey, TValue>> src, TKey key, TValue value)
    where TKey : IComparable<TKey>
Parameters
Type Name Description
RedBlackTree<System.Collections.Generic.KeyValuePair<TKey, TValue>> src
TKey key
TValue value
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TKey
TValue

TryGet<TKey, TValue>(RedBlackTree<KeyValuePair<TKey, TValue>>, TKey, out TValue)

Tries to get a value associated with the given key.

Declaration
public static bool TryGet<TKey, TValue>(this RedBlackTree<KeyValuePair<TKey, TValue>> src, TKey key, out TValue result)
    where TKey : IComparable<TKey>
Parameters
Type Name Description
RedBlackTree<System.Collections.Generic.KeyValuePair<TKey, TValue>> src
TKey key
TValue result
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TKey
TValue
In This Article
Back to top Generated by DocFX