SelfClear() публичный Метод

public SelfClear ( ) : void
Результат void
Пример #1
0
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 private SymbolData AddTo(string name, SymbolData[] newdata, int newhashmask)
 {
     // similar to Add, except for adding member to new hash space.
     if (name == null)
     {
         return null;
     }
     // at this point, the member must not exist in destination hash space
     int hash;
     hash = name.GetHashCode();
     SymbolData lv1 = newdata[hash & newhashmask];
     SymbolData data;
     if ((lv1.mSymFlags & SYMBOL_USING) != 0)
     {
         // lv1 is using
         // make a chain and insert it after lv1
         data = new SymbolData();
         data.SelfClear();
         data.mNext = lv1.mNext;
         lv1.mNext = data;
         data.SetName(name, hash);
         data.mSymFlags |= SYMBOL_USING;
     }
     else
     {
         // lv1 is unused
         if ((lv1.mSymFlags & SYMBOL_INIT) == 0)
         {
             lv1.SelfClear();
         }
         lv1.SetName(name, hash);
         lv1.mSymFlags |= SYMBOL_USING;
         data = lv1;
     }
     // count is not incremented
     return data;
 }
Пример #2
0
 // Adds the symbol, returns the newly created data;
 // if already exists, returns the data.
 /// <exception cref="Kirikiri.Tjs2.TJSException"></exception>
 private SymbolData Add(string name)
 {
     // add a data element named "name".
     // return existing element if the element named "name" is already alive.
     if (name == null)
     {
         return null;
     }
     SymbolData data;
     data = Find(name);
     if (data != null)
     {
         // the element is already alive
         return data;
     }
     int hash = name.GetHashCode();
     int pos = (hash & mHashMask);
     //if( LOGD ) Logger.log("Symbol Pos:"+pos);
     SymbolData lv1 = mSymbols[pos];
     if ((lv1.mSymFlags & SYMBOL_USING) != 0)
     {
         // lv1 is using
         // make a chain and insert it after lv1
         data = new SymbolData();
         data.SelfClear();
         data.mNext = lv1.mNext;
         lv1.mNext = data;
         data.SetName(name, hash);
         data.mSymFlags |= SYMBOL_USING;
     }
     else
     {
         // lv1 is unused
         if ((lv1.mSymFlags & SYMBOL_INIT) == 0)
         {
             lv1.SelfClear();
         }
         lv1.SetName(name, hash);
         lv1.mSymFlags |= SYMBOL_USING;
         data = lv1;
     }
     mCount++;
     return data;
 }