An implementation of the IMap interface that uses a balanced binary tree for storing the dictionary mappings.
sealed class
|
TreeMap
|
with
|
<TKey>
|
||
<TValue>
|
|||||
implements
|
ISortedMap<TKey, TValue>
|
||||
extends
|
MapConstBase<TKey, TValue>
|
The number of elements in this collection.
public
override
property
|
Count
{
get
}
|
||
type
|
int32
|
||
value
|
|
The number of elements. | |
implements
|
BagConstBase.Count
|
Returns a read-only set of all keys in this dictionary.
public
override
property
|
Keys
{
get
}
|
||
type
|
IBagConst<TKey>
|
||
value
|
|
The set of keys. | |
implements
|
MapConstBase.Keys
|
Returns the maximum entry of this dictionary.
public
property
|
MaximumEntry
{
get
}
|
||
type
|
MapEntry<TKey, TValue>
|
||
value
|
The maximum entry. | ||
implements
|
ISortedMapConst.MaximumEntry
|
Returns the maximum key of this dictionary.
public
property
|
MaximumKey
{
get
}
|
||
type
|
TKey
|
||
value
|
The maximum key. | ||
implements
|
ISortedMapConst.MaximumKey
|
Returns the minimum entry of this dictionary.
public
property
|
MinimumEntry
{
get
}
|
||
type
|
MapEntry<TKey, TValue>
|
||
value
|
The minimum entry. | ||
implements
|
ISortedMapConst.MinimumEntry
|
Returns the minimum key of this dictionary.
public
property
|
MinimumKey
{
get
}
|
||
type
|
TKey
|
||
value
|
The minimum key. | ||
implements
|
ISortedMapConst.MinimumKey
|
Returns a read-only collection of all values in this dictionary.
public
override
property
|
Values
{
get
}
|
||
type
|
IBagConst<TValue>
|
||
value
|
|
The collection of values. | |
implements
|
MapConstBase.Values
|
Creates a new instance of TreeMap.
public
constructor
|
TreeMap
(CompareDelegate<TKey> compare,
int32 initialCapacity = 12)
|
||
params
|
compare
|
[not-null]
|
The comparison for keys. |
initialCapacity
|
[>=0]
|
The
initial
capacity
of
the
dictionary,
in
mapped
values.
Defaults
to
12 .
|
Removes all key/value pairs from the map.
public
method
|
Clear
()
|
||
implements
|
IMap.Clear
|
Returns if this collection contains the given element.
[Pure]
|
||||
public
override
method
|
Contains
(MapEntry<TKey, TValue> element)
|
|||
type
|
bool
|
|||
params
|
element
|
The element. | ||
returns
|
true
if
element
is
contained
in
this
collection,
false
if
not.
|
|||
inherited
|
MapConstBase.Contains
|
Returns if this collection contains all given elements.
public
method
|
ContainsAll
(IEnumerable<T> elements)
|
||
type
|
bool
|
||
params
|
elements
|
[not-null]
|
The elements. |
returns
|
true
if
all
elements
are
contained
in
this
collection,
false
if
not.
|
||
inherited
|
BagConstBase.ContainsAll
|
Returns if this map contains an entry for the given key.
public
override
method
|
ContainsKey
(TKey key)
|
||
type
|
bool
|
||
params
|
key
|
The key. | |
returns
|
true
if
the
map
contains
an
entry
for
the
key,
false
if
it
does
not.
|
||
implements
|
MapConstBase.ContainsKey
|
public
method
|
EqualsEntry
(MapEntry<TKey, TValue> a,
MapEntry<TKey, TValue> b)
|
||
type
|
bool
|
||
params
|
a
|
||
b
|
|||
inherited
|
MapConstBase.EqualsEntry
|
Returns the first enumerated value.
[Pure]
|
||||
public
virtual
method
|
First
()
|
|||
type
|
T
|
|||
returns
|
The first enumerated value. | |||
inherited
|
BagConstBase.First
|
Exceptions:
Returns the value that is currently mapped to the given key.
public
override
method
|
Get
(TKey key,
TValue defaultValue = default(TValue))
|
||
type
|
TValue
|
||
params
|
key
|
The key. | |
defaultValue
|
The default value to return in case the map does not contain an entry for key. | ||
returns
|
The entry value. | ||
implements
|
MapConstBase.Get
|
public
override
method
|
GetEnumerator
()
|
||
type
|
IEnumerator<MapEntry<TKey, TValue>>
|
||
implements
|
EnumerableBase.GetEnumerator
|
Returns the last enumerated value.
[Pure]
|
||||
public
virtual
method
|
Last
()
|
|||
type
|
T
|
|||
returns
|
The last enumerated value. | |||
inherited
|
BagConstBase.Last
|
Exceptions:
Maps the given value to the specified key.
public
method
|
Put
(TKey key,
TValue value)
|
||
type
|
TValue
|
||
params
|
key
|
The key. | |
value
|
The value. | ||
returns
|
The previously mapped value. | ||
implements
|
IMap.Put
|
Removes the mapping for the given key.
public
method
|
Remove
(TKey key)
|
||
type
|
TValue
|
||
params
|
key
|
The key. | |
returns
|
The previously mapped value. | ||
implements
|
IMap.Remove
|
Removes the maximum entry from this dictionary.
public
method
|
RemoveMaximumEntry
()
|
||
type
|
MapEntry<TKey, TValue>
|
||
returns
|
The removed entry. | ||
implements
|
ISortedMap.RemoveMaximumEntry
|
Removes the maximum key from this dictionary.
public
method
|
RemoveMaximumKey
()
|
||
type
|
TKey
|
||
returns
|
The removed key. | ||
implements
|
ISortedMap.RemoveMaximumKey
|
Removes the minimum entry from this dictionary..
public
method
|
RemoveMinimumEntry
()
|
||
type
|
MapEntry<TKey, TValue>
|
||
returns
|
The removed entry. | ||
implements
|
ISortedMap.RemoveMinimumEntry
|
Removes the minimum key from this dictionary..
public
method
|
RemoveMinimumKey
()
|
||
type
|
TKey
|
||
returns
|
The removed key. | ||
implements
|
ISortedMap.RemoveMinimumKey
|
Returns the elements of this enumerable object as a fresh array.
[Pure]
|
||||
public
method
|
ToArray
()
|
|||
type
|
T[]
|
|||
returns
|
|
The array of elements. | ||
inherited
|
BagConstBase.ToArray
|
Returns the elements of this collection as an array.
public
override
method
|
ToArrayCopy
(MapEntry<TKey, TValue>[] array,
int32 offset = 0)
|
||
type
|
MapEntry<TKey, TValue>[]
|
||
params
|
array
|
[not-null]
|
The output array. |
offset
|
[>=0]
|
Offset
into
array.
Defaults
to
0 .
|
|
returns
|
|
The filled array. | |
implements
|
BagConstBase.ToArrayCopy
|
Remarks:
The elements in this collection will be copied into the given array, starting at the array index specified by offset.
Returns the elements of this enumerable object as a list.
[Pure]
|
||||
public
virtual
method
|
ToArrayList
()
|
|||
type
|
IArrayVector<T>
|
|||
returns
|
|
The list of elements. | ||
inherited
|
BagConstBase.ToArrayList
|
Returns the elements of this enumerable object as a list.
[Pure]
|
||||
public
virtual
method
|
ToList
()
|
|||
type
|
IVectorConst<T>
|
|||
returns
|
|
The list of elements. | ||
inherited
|
BagConstBase.ToList
|