Bisect() public method

Find the index where this value would fit in if it was in the range collection. The value should not already be in the collection.
public Bisect ( long value ) : int
value long
return int
Ejemplo n.º 1
0
 public void BisectMultiple()
 {
     LongRangeCollection lrc = new LongRangeCollection(0, 500000);
     lrc.AddRange(50, 100);
     lrc.AddRange(150, 200);
     Assert.AreEqual(0, lrc.Bisect(25));
     Assert.AreEqual(1, lrc.Bisect(120));
     Assert.AreEqual(2, lrc.Bisect(300));
 }
Ejemplo n.º 2
0
 public void BisectSingle()
 {
     LongRangeCollection lrc = new LongRangeCollection(0, 500);
     lrc.AddRange(0, 100);
     Assert.AreEqual(1, lrc.Bisect(120));
 }
Ejemplo n.º 3
0
 public void BisectEmpty()
 {
     LongRangeCollection lrc = new LongRangeCollection(0, 500);
     Assert.AreEqual(0, lrc.Bisect(120));
 }