public void sIndexShift(long from, long amount)
        {
            if (useReachNotify)
            {
                return;
            }
            from = from + 1;
            List <NamedItem <long, long> > items = sInxLblFrom(from);

            foreach (NamedItem <long, long> item in items)
            {
                store.Del(item.Name);
                long inx;
                if (amount < 0)
                {
                    inx = Math.Max((int)(item.Name >> 32) + amount, from);
                }
                else
                {
                    inx = (int)(item.Name >> 32) + amount;
                }
                long lbl = (int)((item.Name & 0xFFFFFFFF) + 2147483648L);
                store.Add(((0L + inx) << 32) | ((-2147483648L + (int)lbl) & 0xFFFFFFFF), inx);
                store[((0L) << 32) | ((-2147483648L + (int)lbl) & 0xFFFFFFFF)] = inx;
            }
        }
Example #2
0
 public void IndexShift(int from, int amount, int dtn) //Direction dtn = 1 if we search Indexes of Starting Labels but dtn = -1 when we search for Indexes of Ending Labels
 {
     if (useReachNotify)
     {
         return;
     }
     from = from + 1;
     foreach (long key in InxLblFrom(from, dtn))
     {
         store.Del(key);
         int inx = 0;
         if (amount < 0)
         {
             inx = Math.Max(dtn * (int)(key >> 32) + amount, from + (int)((dtn - 1) / 2));
         }
         else
         {
             inx = dtn * (int)(key >> 32) + amount;
         }
         long lbl = dtn * (int)((key & 0xFFFFFFFF) + 2147483648L);
         store.Add(pack(dtn * inx, dtn * lbl), dtn * inx);
         store[pack(0, dtn * lbl)] = dtn * inx;
     }
 }