当前位置: 首页>>代码示例>>C#>>正文


C# SortedSet.GetViewBetween方法代码示例

本文整理汇总了C#中System.Collections.SortedSet.GetViewBetween方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.GetViewBetween方法的具体用法?C# SortedSet.GetViewBetween怎么用?C# SortedSet.GetViewBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.SortedSet的用法示例。


在下文中一共展示了SortedSet.GetViewBetween方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ViewUnionWith_oor

		public void ViewUnionWith_oor ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (4, 8);
			view.UnionWith (new [] {1});
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:6,代码来源:SortedSetTest.cs

示例2: ViewSymmetricExceptWith

		public void ViewSymmetricExceptWith ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (4, 8);
			view.SymmetricExceptWith (new [] { 4, 5, 6, 6, 4 });
			Assert.IsTrue (view.SequenceEqual (new [] { 4, 6, 7 }));
			Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 4, 6, 7, 9 }));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:8,代码来源:SortedSetTest.cs

示例3: ViewCount

		public void ViewCount ()
		{
			var set = new SortedSet<int> { 1, 3, 4, 5, 6, 7, 8, 9 };
			var view = set.GetViewBetween (4, 8);

			Assert.AreEqual (5, view.Count);
			set.Remove (5);
			Assert.AreEqual (4, view.Count);
			set.Add (10);
			Assert.AreEqual (4, view.Count);
			set.Add (6);
			Assert.AreEqual (4, view.Count);
			set.Add (5);
			Assert.AreEqual (5, view.Count);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:15,代码来源:SortedSetTest.cs

示例4: ViewIntersectWith

		public void ViewIntersectWith ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (4, 8);
			view.IntersectWith (new [] { 1, 5, 9 });
			Assert.IsTrue (view.SequenceEqual (new [] { 5 }));
			Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 5, 9 }));
			view.IntersectWith (new [] { 1, 2 });
			Assert.IsTrue (view.SequenceEqual (new int [] {}));
			Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 9 }));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:11,代码来源:SortedSetTest.cs

示例5: ViewMin

		public void ViewMin ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };

			var view = set.GetViewBetween (4, 8);
			Assert.AreEqual (5, view.Min);

			view = set.GetViewBetween (-2, 4);
			Assert.AreEqual (1, view.Min);

			view = set.GetViewBetween (1, 9);
			Assert.AreEqual (1, view.Min);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:13,代码来源:SortedSetTest.cs

示例6: ViewMax

		public void ViewMax ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };

			var view = set.GetViewBetween (4, 8);
			Assert.AreEqual (7, view.Max);

			view = set.GetViewBetween (4, 55);
			Assert.AreEqual (9, view.Max);

			view = set.GetViewBetween (1, 9);
			Assert.AreEqual (9, view.Max);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:13,代码来源:SortedSetTest.cs

示例7: ViewGetView

		public void ViewGetView ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (3, 7);
			view = view.GetViewBetween (4, 6);

			Assert.IsTrue (view.SequenceEqual (new [] { 5 }));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:8,代码来源:SortedSetTest.cs

示例8: GetViewBetweenLowerBiggerThanUpper

		public void GetViewBetweenLowerBiggerThanUpper ()
		{
			var set = new SortedSet<int> { 1, 2, 3, 4, 5, 6 };
			set.GetViewBetween (4, 2);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:5,代码来源:SortedSetTest.cs

示例9: ViewClear

		public void ViewClear ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (3, 7);

			view.Clear ();

			Assert.AreEqual (0, view.Count);
			Assert.IsTrue (set.SequenceEqual (new [] { 1, 9 }));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:10,代码来源:SortedSetTest.cs

示例10: ViewGetViewUpperOutOfRange

		public void ViewGetViewUpperOutOfRange ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (3, 7);
			view.GetViewBetween (5, 9);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:6,代码来源:SortedSetTest.cs

示例11: ViewRemove

		public void ViewRemove ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (3, 7);

			Assert.IsTrue (view.Remove (3));
			Assert.IsFalse (view.Contains (3));
			Assert.IsFalse (set.Contains (3));
			Assert.IsFalse (view.Remove (9));
			Assert.IsTrue (set.Contains (9));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:11,代码来源:SortedSetTest.cs

示例12: ViewAddOutOfRange

		public void ViewAddOutOfRange ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7 };
			var view = set.GetViewBetween (3, 5);

			view.Add (7);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:7,代码来源:SortedSetTest.cs

示例13: ViewAdd

		public void ViewAdd ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7 };
			var view = set.GetViewBetween (3, 5);

			Assert.IsTrue (view.Add (4));
			Assert.IsTrue (view.Contains (4));
			Assert.IsTrue (set.Contains (4));

			Assert.IsFalse (view.Add (5));
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:11,代码来源:SortedSetTest.cs

示例14: ViewSymmetricExceptWith_oor

		public void ViewSymmetricExceptWith_oor ()
		{
			var set = new SortedSet<int> { 1, 3, 5, 7, 9 };
			var view = set.GetViewBetween (4, 8);
			view.SymmetricExceptWith (new [] {2});
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:6,代码来源:SortedSetTest.cs

示例15: EmptySubView

		void EmptySubView (SortedSet<int> set)
		{
			var view = set.GetViewBetween (-20, -15);
			Assert.AreEqual (0, view.Count);
			Assert.AreEqual (0, view.Min);
			Assert.AreEqual (0, view.Max);

			view = set.GetViewBetween (15, 20);
			Assert.AreEqual (0, view.Count);
			Assert.AreEqual (0, view.Min);
			Assert.AreEqual (0, view.Max);
		}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:12,代码来源:SortedSetTest.cs


注:本文中的System.Collections.SortedSet.GetViewBetween方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。