Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal comparer As IComparer(Of T) _ ) |
C# | |
---|---|
public BTreeList<T>( IComparer<T> comparer ) |
Parameters
- comparer
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.NET | Copy 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 |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
BTreeList<T> ClassBTreeList<T> Members
Overload List