Beispiel #1
0
 // public methods
 public override IndexMap Add(int index, int originalIndex)
 {
     if (_count == 0)
     {
         _index = index;
         _originalIndex = originalIndex;
         _count = 1;
         return this;
     }
     else if (index == _index + _count && originalIndex == _originalIndex + _count)
     {
         _count += 1;
         return this;
     }
     else
     {
         var dictionaryMap = new DictionaryBased(_index, _originalIndex, _count);
         dictionaryMap.Add(index, originalIndex);
         return dictionaryMap;
     }
 }
Beispiel #2
0
 // public methods
 public override IndexMap Add(int index, int originalIndex)
 {
     if (_count == 0)
     {
         _index         = index;
         _originalIndex = originalIndex;
         _count         = 1;
         return(this);
     }
     else if (index == _index + _count && originalIndex == _originalIndex + _count)
     {
         _count += 1;
         return(this);
     }
     else
     {
         var dictionaryMap = new DictionaryBased(_index, _originalIndex, _count);
         dictionaryMap.Add(index, originalIndex);
         return(dictionaryMap);
     }
 }