TreeMap

Description

class Tinman.Core.Collections.TreeMap
<TKey>
<TValue>

Derived from

MapBase<TKey, TValue> abstract
ISortedMap<TKey, TValue>

An implementation of the IMap interface that uses a balanced binary tree for storing the dictionary mappings.

A specialized container may be created by subclassing TreeMap and specifying a suitable CompareDelegate in the constructor, optionally overriding the following methods to provide custom semantics:

Public / Constructors

Copy


public static method Copy → (2)

values in : IMapConst<TKey, TValue>

The values to copy or null to create an empty map.

compare opt : CompareDelegate<TKey> = null

The comparison delegate. If null, IMapConst.MethodComparisonKey of values in will be used, which must not be null in this case.

returns → TreeMap<TKey, TValue>

The created TreeMap object.

Copies the given values in into a compact TreeMap.

Tree​Map


public constructor TreeMap → (2)

compare in : CompareDelegate<TKey>

[not-null]
The comparison for keys.

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in mapped values.

Creates a new instance of TreeMap.

Wrap


[Pure]
public static method Wrap → (3)

key in : TKey

The map element key.

value in : TValue

The map element value.

compare opt : CompareDelegate<TKey> = null

[not-null]
The comparison for keys.

returns → TreeMap<TKey, TValue>

The set.

Creates a compact map that initially holds the given element.