T
CSharpTest.Net
BTreeList<T> Class
Members  Example  See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace : BTreeList<T> Class

Glossary Item Box

Implements an IList interface for an in-memory B+Tree of unique values

Syntax

Visual Basic (Declaration) 
Public Class BTreeList(Of T) 
C# 
public class BTreeList<T> 

Type Parameters

T

Example

Library/Library.Test/TestBTreeList.cs

C#Copy Code
BTreeList<int> data = new BTreeList<int>(Comparer);
for (int i = 0; i < 100; i++)
    Assert.IsTrue(data.TryAddItem(i));

Assert.AreEqual(50, new List<int>(data.EnumerateFrom(50)).Count);
Assert.AreEqual(25, new List<int>(data.EnumerateFrom(75)).Count);

for (int i = 0; i < 100; i++)
{
    int first = -1;
    foreach (int kv in data.EnumerateFrom(i))
    {
        first = kv;
        break;
    }
    Assert.AreEqual(i, first);
}
VB.NETCopy Code
Dim data As New BTreeList(Of Integer)(Comparer)
Dim i As Integer = 0
While i < 100
    Assert.IsTrue(data.TryAddItem(i))
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Assert.AreEqual(50, New List(Of Integer)(data.EnumerateFrom(50)).Count)
Assert.AreEqual(25, New List(Of Integer)(data.EnumerateFrom(75)).Count)

Dim i As Integer = 0
While i < 100
    Dim first As Integer = -1
    For Each kv As Integer In data.EnumerateFrom(i)
        first = kv
        Exit For
    Next
    Assert.AreEqual(i, first)
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Inheritance Hierarchy

System.Object
   CSharpTest.Net.Collections.BTreeList<T>

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys