Esempio n. 1
0
        static invertedList getList(Hashtable ht, int i, int len)
        {
            pair x = new pair();
            x.l = len;
            x.i = i;
            invertedList L = null;
            if (ht.ContainsKey(x))
                L = (invertedList)ht[x];
            else
            {
                L = new invertedList();
                ht.Add(x, L);
            }

            return L;
        }
Esempio n. 2
0
 static invertedList GetandCreateList(Hashtable ht, int i, int len)
 {
     invertedList L = GetList(ht, i, len);
     if (L != null)
         return L;
     else
     {
         L = new invertedList();
         pair x = new pair();
         x.l = len;
         x.i = i;
         ht.Add(x, L);
         //add the list to hashtable
         ArrayList LL = (ArrayList)invlist_length[len];
         if (LL == null)
         {
             LL = new ArrayList();
             LL.Add(L);
             invlist_length.Add(len, LL);
         }
         else
         {
             LL.Add(L);
         }
         //---
     }
     return L;
 }
Esempio n. 3
0
 static invertedList GetandCreateList(Hashtable ht, int i, int len)
 {
     invertedList L = GetList(ht, i, len);
     if (L != null)
         return L;
     else
     {
         L = new invertedList();
         pair x = new pair();
         x.l = len;
         x.i = i;
         ht.Add(x, L);
     }
     return L;
 }
Esempio n. 4
0
        static invertedList getList(int i, int len)
        {
            pair x = new pair();
            x.l = len;
            x.i = i;
            invertedList L = null;
            if (invertedlists.ContainsKey(x))
                L = (invertedList)invertedlists[x];
            else
            {
                L = new invertedList();
                invertedlists.Add(x, L);
            }
            //added to the inverted by the length

            if (invertedlists_by_length.ContainsKey(len))
            {
                ArrayList l = (ArrayList)invertedlists_by_length[len];
                l.Add(L);
            }
            else
            {
                ArrayList l = new ArrayList();
                l.Add(L);
                invertedlists_by_length.Add(len, l);
            }

            return L;
        }