natix.CompactDS.DiffSet.AddItem C# (CSharp) Method

AddItem() protected method

Internal method to add an (ordered) item to the set
protected AddItem ( int current, int prev ) : void
current int
prev int
return void
        protected void AddItem(int current, int prev)
        {
            if (current == 0) {
                prev = AccStart;
            }

            this.WriteNewDiff (current - prev);
            this.M++;
            if (this.M % this.B == 0) {
                this.Commit ();
                this.Samples.Add (current);
                this.Offsets.Add (this.Stream.CountBits);
                //Console.WriteLine ("ADDING SAMPLE M: {0}, current: {1}, prev: {2}, num-samples: {3}",
                //	this.M, current, prev, this.Samples.Count);
                }
            if (current >= this.N) {
                this.N = current + 1;
            }
        }