Generated by DocFX

Class RedBlackTreeDictionary<TKey, TValue>

Sorted dictionary based on a red-black tree.

Inheritance
System.Object
RedBlackTreeDictionary<TKey, TValue>
Namespace: ISynergy.Framework.Core.Collections
Assembly: ISynergy.Framework.Core.dll
Syntax
public class RedBlackTreeDictionary<TKey, TValue> : IDictionary<TKey, TValue>
Type Parameters
Name Description
TKey

The type of keys in the collection.

TValue

The type of the values in the collection

Constructors

View Source

RedBlackTreeDictionary()

Creates a new RedBlackTreeDictionary<TKey, TValue> using the default comparer for the TKey.

Declaration
public RedBlackTreeDictionary()
View Source

RedBlackTreeDictionary(IComparer<TKey>)

Creates a new RedBlackTreeDictionary<TKey, TValue>.

Declaration
public RedBlackTreeDictionary(IComparer<TKey> comparer)
Parameters
Type Name Description
IComparer<TKey> comparer

Properties

View Source

Count

Gets the number of elements on this dictionary.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32
View Source

IsReadOnly

Gets a value indicating whether this instance is read only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

Returns false.

View Source

Item[TKey]

Gets or sets the element with the specified key.

Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type Name Description
TKey key

The key.

Property Value
Type Description
TValue
View Source

Keys

Gets an ICollection{T} containing the keys of the RedBlackTreeDictionary<TKey, TValue>.

Declaration
public ICollection<TKey> Keys { get; }
Property Value
Type Description
ICollection<TKey>
View Source

Values

Gets an ICollection{T} containing the values of the RedBlackTreeDictionary<TKey, TValue>.

Declaration
public ICollection<TValue> Values { get; }
Property Value
Type Description
ICollection<TValue>

Methods

View Source

Add(TKey, TValue)

Adds an element with the provided key and value to the IDictionary<, >.

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key

The object to use as the key of the element to add.

TValue value

The object to use as the value of the element to add.

View Source

Add(KeyValuePair<TKey, TValue>)

Adds an element with the provided key and value to the dictionary.

Declaration
public void Add(KeyValuePair<TKey, TValue> item)
Parameters
Type Name Description
KeyValuePair<TKey, TValue> item

The key-value pair containing the desired key and the value to be added.

View Source

Clear()

Removes all elements from the dictionary.

Declaration
public void Clear()
View Source

Contains(KeyValuePair<TKey, TValue>)

Determines whether the dictionary contains a specific value.

Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
Type Name Description
KeyValuePair<TKey, TValue> item

The object to locate in the dictionary.

Returns
Type Description
System.Boolean

true if item is found in the dictionary; otherwise, false.

View Source

ContainsKey(TKey)

Determines whether the dictionary contains an element with the specified key.

Declaration
public bool ContainsKey(TKey key)
Parameters
Type Name Description
TKey key

The key to locate in the dictionary.

Returns
Type Description
System.Boolean

true if the dictionary contains an element with the key; otherwise, false.

View Source

CopyTo(KeyValuePair<TKey, TValue>[], Int32)

Copies the elements of this dictionary to an array, starting at a particular array index.

Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
Type Name Description
KeyValuePair<TKey, TValue>[] array

The one-dimensional Array that is the destination of the elements copied from ICollection. The array must have zero-based indexing.

System.Int32 arrayIndex

The zero-based index in array at which copying begins.

View Source

GetEnumerator()

Returns an enumerator that iterates through the dictionary.

Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<TKey, TValue>>

An IEnumerator{T} object that can be used to iterate through the collection.

View Source

GetNext(TKey)

Gets the next key-value pair in the dictionary whose key is the immediate successor to the given key.

Declaration
public KeyValuePair<TKey, TValue> GetNext(TKey key)
Parameters
Type Name Description
TKey key

The key whose successor must be found.

Returns
Type Description
KeyValuePair<TKey, TValue>

The key-value pair whose key is the immediate successor of key.

View Source

GetPrevious(TKey)

Gets the next key-value pair in the dictionary whose key is the immediate ancestor of the given key.

Declaration
public KeyValuePair<TKey, TValue> GetPrevious(TKey key)
Parameters
Type Name Description
TKey key

The key whose ancestor must be found.

Returns
Type Description
KeyValuePair<TKey, TValue>

The key-value pair whose key is the immediate ancestor of key.

View Source

Max()

Gets the pair with the maximum key stored in the dictionary.

Declaration
public KeyValuePair<TKey, TValue> Max()
Returns
Type Description
KeyValuePair<TKey, TValue>

The with the minimum key present in the dictionary.

View Source

Min()

Gets the pair with the minimum key stored in the dictionary.

Declaration
public KeyValuePair<TKey, TValue> Min()
Returns
Type Description
KeyValuePair<TKey, TValue>

The with the minimum key present in the dictionary.

View Source

Remove(TKey)

Removes the element with the specified key from the dictionary.

Declaration
public bool Remove(TKey key)
Parameters
Type Name Description
TKey key

The key of the element to remove.

Returns
Type Description
System.Boolean

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original dictionary.

View Source

Remove(KeyValuePair<TKey, TValue>)

Removes the first occurrence of a specific object from the dictionary.

Declaration
public bool Remove(KeyValuePair<TKey, TValue> item)
Parameters
Type Name Description
KeyValuePair<TKey, TValue> item

The object to remove from the dictionary.

Returns
Type Description
System.Boolean

true if item was successfully removed from the dictionary; otherwise, false. This method also returns false if item is not found in the original dictionary.

View Source

TryGetNext(TKey, out KeyValuePair<TKey, TValue>)

Gets the next key-value pair in the dictionary whose key is the immediate successor to the given key.

Declaration
public bool TryGetNext(TKey key, out KeyValuePair<TKey, TValue> next)
Parameters
Type Name Description
TKey key

The key whose successor must be found.

KeyValuePair<TKey, TValue> next

The key-value pair whose key is the immediate sucessor of key, returned as an out parameter.

Returns
Type Description
System.Boolean

True if there was a successor in the dictionary; false otherwise.

View Source

TryGetPrevious(TKey, out KeyValuePair<TKey, TValue>)

Gets the next key-value pair in the dictionary whose key is the immediate ancestor of the given key.

Declaration
public bool TryGetPrevious(TKey key, out KeyValuePair<TKey, TValue> prev)
Parameters
Type Name Description
TKey key

The key whose ancestor must be found.

KeyValuePair<TKey, TValue> prev

The key-value pair whose key is the immediate ancestor of key, returned as an out parameter.

Returns
Type Description
System.Boolean

True if there was an ancestor in the dictionary; false otherwise.

View Source

TryGetValue(TKey, out TValue)

Gets the value associated with the specified key.

Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type Name Description
TKey key

The key whose value to get.

TValue value

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns
Type Description
System.Boolean

true if the dictionary contains an element with the specified key; otherwise, false.

Extension Methods

Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)