コード例 #1
0
		public BTreeRangeUnion(SortedCollection4 sorted)
		{
			if (null == sorted)
			{
				throw new ArgumentNullException();
			}
			_ranges = ToArray(sorted);
		}
コード例 #2
0
ファイル: BTreeAlgebra.cs プロジェクト: bvangrinsven/db4o-net
		private static void CollectIntersections(SortedCollection4 collection, BTreeRangeUnion
			 union, BTreeRangeSingle single)
		{
			IEnumerator ranges = union.Ranges();
			while (ranges.MoveNext())
			{
				BTreeRangeSingle current = (BTreeRangeSingle)ranges.Current;
				if (single.Overlaps(current))
				{
					collection.Add(single.Intersect(current));
				}
			}
		}
コード例 #3
0
		private static SortedCollection4 ToSortedCollection(BTreeRangeSingle[] ranges)
		{
			if (null == ranges)
			{
				throw new ArgumentNullException();
			}
			SortedCollection4 collection = new SortedCollection4(BTreeRangeSingle.Comparison);
			for (int i = 0; i < ranges.Length; i++)
			{
				BTreeRangeSingle range = ranges[i];
				if (!range.IsEmpty())
				{
					collection.Add(range);
				}
			}
			return collection;
		}
コード例 #4
0
		private void AssertCollection(int[] expected, SortedCollection4 collection)
		{
			Assert.AreEqual(expected.Length, collection.Size());
			ArrayAssert.AreEqual(IntArrays4.ToObjectArray(expected), collection.ToArray(new object
				[collection.Size()]));
		}
コード例 #5
0
		private static BTreeRangeSingle[] ToArray(SortedCollection4 collection)
		{
			return (BTreeRangeSingle[])collection.ToArray(new BTreeRangeSingle[collection.Size
				()]);
		}
コード例 #6
0
ファイル: BTreeAlgebra.cs プロジェクト: bvangrinsven/db4o-net
		private static IBTreeRange ToRange(SortedCollection4 sorted)
		{
			if (1 == sorted.Size())
			{
				return (IBTreeRange)sorted.SingleElement();
			}
			return new BTreeRangeUnion(sorted);
		}