Example #1
0
 public void Add(Key p_key, Value p_value)
 {
     if (IsEmpty)
     {
         key     = p_key;
         value   = p_value;
         IsEmpty = false;
     }
     else
     {
         SCItem <Key, Value> previous = null;
         SCItem <Key, Value> current  = this;
         do
         {
             if (Equals(p_key, current.key))
             {
                 current.value = p_value;
                 return;
             }
             else
             {
                 previous = current;
                 current  = current.Next;
             }
         }while (current != null);
         previous.Next = new SCItem <Key, Value>(p_key, p_value);
     }
 }
Example #2
0
 private void GenerateEmptyArray()
 {
     tables = new SCItem <Key, Value> [size];
     for (int i = 0; i < tables.Length; i++)
     {
         tables[i] = new SCItem <Key, Value>();
     }
 }