Skip to content

IIndexAccessTree

Kal Ahmed edited this page Sep 26, 2016 · 1 revision

Home > Trees > ITree > IIndexAccessTree

IIndexAccessTree

The IndexAccessTree interface extends the basic ITree interface with additional methods that provide indexed access into a tree such that it can be accessed similar to how you would access a list/array which can be very useful in some circumstances.

IIndexAccessTree API

All our examples here assume we have a IIndexTree mapping strings to integers.

The basic IIndexAccessTree API looks very similar to a normal .NET collection:

// Gets the value at a given Index
int value = tree.GetValueAt(19);

// Sets the value at a given Index
tree.SetValueAt(19, "example");

// Removes the key-value pair at a given Index
tree.RemoveAt(19);

Clone this wiki locally