Beispiel #1
0
        public void TestPartiallyEnumerate()
        {
            var sortedSplitList = new SortedSplitList <TestObject>(new CompareByDateId());

            sortedSplitList.Add(new TestObject()
            {
                Id = 1, Date = DateTime.Parse("01/01/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 2, Date = DateTime.Parse("01/01/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 3, Date = DateTime.Parse("01/01/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 4, Date = DateTime.Parse("01/01/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 5, Date = DateTime.Parse("01/02/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 6, Date = DateTime.Parse("01/02/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 7, Date = DateTime.Parse("01/02/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 8, Date = DateTime.Parse("01/03/2003")
            });
            sortedSplitList.Add(new TestObject()
            {
                Id = 9, Date = DateTime.Parse("01/03/2003")
            });

            Assert.AreEqual(4, sortedSplitList.PartiallyEnumerate(new TestObject()
            {
                Date = DateTime.Parse("01/01/2003")
            }, new CompareByDate()).Count());
            Assert.AreEqual(3, sortedSplitList.PartiallyEnumerate(new TestObject()
            {
                Date = DateTime.Parse("01/02/2003")
            }, new CompareByDate()).Count());
            Assert.AreEqual(2, sortedSplitList.PartiallyEnumerate(new TestObject()
            {
                Date = DateTime.Parse("01/03/2003")
            }, new CompareByDate()).Count());


            foreach (var testObject in sortedSplitList.PartiallyEnumerate(new TestObject()
            {
                Date = DateTime.Parse("01/01/2003")
            }, new CompareByDate()))
            {
                Console.WriteLine(testObject.Id);
            }
        }
Beispiel #2
0
        protected override IEnumerable <Cell> GetCells_internal(FloatWithSizeMath.FloatWithSize[] aabb)
        {
            var result = SortedSplitListCellTree.PartiallyEnumerate(new Cell(aabb));

            return(result);
        }