コード例 #1
0
    public static ODBNode <T> New(ODBList <T> list, T self)
    {
        ODBNode <T> oDBNode;

        if (!ODBNode <T> .recycle.Pop(out oDBNode))
        {
            oDBNode = new ODBNode <T>();
        }
        oDBNode.Setup(list, self);
        return(oDBNode);
    }
コード例 #2
0
ファイル: ODBList!1.cs プロジェクト: salvadj1/RustSource
 protected void DoUnionWith(ODBList <T> list)
 {
     if (list.any && (list != this))
     {
         ODBSibling <T> first = list.first;
         do
         {
             T self = first.item.self;
             first = first.item.n;
             if (this.hashSet.Add(self))
             {
                 ODBNode <T> .New((ODBList <T>) this, self);
             }
         }while (first.has);
     }
 }
コード例 #3
0
    protected void DoUnionWith(ODBList <T> list)
    {
        if (!list.any || list == this)
        {
            return;
        }
        ODBSibling <T> oDBSibling = list.first;

        do
        {
            T t = oDBSibling.item.self;
            oDBSibling = oDBSibling.item.n;
            if (!this.hashSet.Add(t))
            {
                continue;
            }
            ODBNode <T> .New(this, t);
        }while (oDBSibling.has);
    }
コード例 #4
0
 public void Dispose()
 {
     if (this.hasList)
     {
         if (this.n.has)
         {
             if (!this.p.has)
             {
                 this.n.item.p   = new ODBSibling <T>();
                 this.list.first = this.n;
                 ODBList <T> ts = this.list;
                 ts.count = ts.count - 1;
             }
             else
             {
                 this.p.item.n = this.n;
                 this.n.item.p = this.p;
                 this.p        = new ODBSibling <T>();
                 ODBList <T> ts1 = this.list;
                 ts1.count = ts1.count - 1;
             }
         }
         else if (!this.p.has)
         {
             this.list.count = 0;
             this.list.any   = false;
             this.list.first = new ODBSibling <T>();
             this.list.last  = new ODBSibling <T>();
         }
         else
         {
             this.p.item.n  = new ODBSibling <T>();
             this.list.last = this.p;
             this.p         = new ODBSibling <T>();
             ODBList <T> ts2 = this.list;
             ts2.count = ts2.count - 1;
         }
         this.hasList = false;
         this.list    = null;
         ODBNode <T> .recycle.Push(this);
     }
 }
コード例 #5
0
 protected void DoSymmetricExceptWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (list.any)
         {
             if (list != this)
             {
                 ODBSibling <T> oDBSibling = list.first;
                 do
                 {
                     T t = oDBSibling.item.self;
                     oDBSibling = oDBSibling.item.n;
                     if (!this.hashSet.Remove(t))
                     {
                         this.hashSet.Add(t);
                         ODBNode <T> .New(this, t);
                     }
                     else
                     {
                         this.KnownFind(t).Dispose();
                     }
                 }while (oDBSibling.has);
             }
             else
             {
                 this.DoClear();
             }
         }
     }
     else if (list.any)
     {
         ODBSibling <T> oDBSibling1 = list.first;
         do
         {
             T t1 = oDBSibling1.item.self;
             oDBSibling1 = oDBSibling1.item.n;
             this.hashSet.Add(t1);
             ODBNode <T> .New(this, t1);
         }while (oDBSibling1.has);
     }
 }
コード例 #6
0
ファイル: ODBList!1.cs プロジェクト: salvadj1/RustSource
 protected void DoSymmetricExceptWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (list.any)
         {
             if (list == this)
             {
                 this.DoClear();
             }
             else
             {
                 ODBSibling <T> first = list.first;
                 do
                 {
                     T self = first.item.self;
                     first = first.item.n;
                     if (this.hashSet.Remove(self))
                     {
                         this.KnownFind(self).Dispose();
                     }
                     else
                     {
                         this.hashSet.Add(self);
                         ODBNode <T> .New((ODBList <T>) this, self);
                     }
                 }while (first.has);
             }
         }
     }
     else if (list.any)
     {
         ODBSibling <T> n = list.first;
         do
         {
             T item = n.item.self;
             n = n.item.n;
             this.hashSet.Add(item);
             ODBNode <T> .New((ODBList <T>) this, item);
         }while (n.has);
     }
 }
コード例 #7
0
ファイル: ODBList!1.cs プロジェクト: salvadj1/RustSource
 protected void DoIntersectWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (list.any)
         {
             if (list != this)
             {
                 this.hashSet.IntersectWith(list.hashSet);
                 int count = this.hashSet.Count;
                 if (count == 0)
                 {
                     while (this.any)
                     {
                         this.first.item.Dispose();
                     }
                 }
                 else
                 {
                     ODBSibling <T> first = this.first;
                     do
                     {
                         ODBNode <T> item = first.item;
                         first = first.item.n;
                         if (!this.hashSet.Contains(item.self))
                         {
                             item.Dispose();
                             if (this.count == count)
                             {
                                 break;
                             }
                         }
                     }while (first.has);
                 }
             }
         }
         else
         {
             this.DoClear();
         }
     }
 }
コード例 #8
0
 protected void DoIntersectWith(ODBList <T> list)
 {
     if (this.any)
     {
         if (!list.any)
         {
             this.DoClear();
         }
         else if (list != this)
         {
             this.hashSet.IntersectWith(list.hashSet);
             int count = this.hashSet.Count;
             if (count != 0)
             {
                 ODBSibling <T> oDBSibling = this.first;
                 do
                 {
                     ODBNode <T> oDBNode = oDBSibling.item;
                     oDBSibling = oDBSibling.item.n;
                     if (this.hashSet.Contains(oDBNode.self))
                     {
                         continue;
                     }
                     oDBNode.Dispose();
                     if (this.count != count)
                     {
                         continue;
                     }
                     break;
                 }while (oDBSibling.has);
             }
             else
             {
                 while (this.any)
                 {
                     this.first.item.Dispose();
                 }
             }
         }
     }
 }
コード例 #9
0
 public void Dispose()
 {
     if (this.hasList)
     {
         if (this.n.has)
         {
             if (this.p.has)
             {
                 this.p.item.n = this.n;
                 this.n.item.p = this.p;
                 this.p        = new ODBSibling <T>();
                 this.list.count--;
             }
             else
             {
                 this.n.item.p   = new ODBSibling <T>();
                 this.list.first = this.n;
                 this.list.count--;
             }
         }
         else if (this.p.has)
         {
             this.p.item.n  = new ODBSibling <T>();
             this.list.last = this.p;
             this.p         = new ODBSibling <T>();
             this.list.count--;
         }
         else
         {
             this.list.count = 0;
             this.list.any   = false;
             this.list.first = new ODBSibling <T>();
             this.list.last  = new ODBSibling <T>();
         }
         this.hasList = false;
         this.list    = null;
         ODBNode <T> .recycle.Push((ODBNode <T>) this);
     }
 }
コード例 #10
0
ファイル: ODBList!1.cs プロジェクト: salvadj1/RustSource
 protected void DoExceptWith(ODBList <T> list)
 {
     if (this.any && list.any)
     {
         if (list == this)
         {
             this.DoClear();
         }
         else
         {
             ODBSibling <T> first = list.first;
             do
             {
                 T self = first.item.self;
                 first = first.item.n;
                 if (this.hashSet.Remove(self))
                 {
                     this.KnownFind(self).Dispose();
                 }
             }while (first.has);
         }
     }
 }
コード例 #11
0
 public ODBReverseEnumerator(ODBList <T> list) : this(list.last)
 {
 }
コード例 #12
0
 public RecycleList <T> UnionList(ODBList <T> list)
 {
     return(this.hashSet.UnionList(list.hashSet));
 }
コード例 #13
0
 public RecycleList <T> SymmetricExceptList(ODBList <T> list)
 {
     return(this.hashSet.SymmetricExceptList(list.hashSet));
 }
コード例 #14
0
ファイル: ODBSet!1.cs プロジェクト: salvadj1/RustSource
 public void UnionWith(ODBList <T> list)
 {
     base.DoUnionWith(list);
 }
コード例 #15
0
ファイル: ODBSet!1.cs プロジェクト: salvadj1/RustSource
 public void IntersectWith(ODBList <T> list)
 {
     base.DoIntersectWith(list);
 }
コード例 #16
0
 public ODBForwardEnumerable(ODBList <T> list) : this(list.last)
 {
 }
コード例 #17
0
ファイル: ODBSet!1.cs プロジェクト: salvadj1/RustSource
 public void ExceptWith(ODBList <T> list)
 {
     base.DoExceptWith(list);
 }
コード例 #18
0
 public RecycleList <T> ExceptList(ODBList <T> list)
 {
     return(this.hashSet.ExceptList(list.hashSet));
 }
コード例 #19
0
ファイル: ODBSet!1.cs プロジェクト: salvadj1/RustSource
 public void SymmetricExceptWith(ODBList <T> list)
 {
     base.DoSymmetricExceptWith(list);
 }
コード例 #20
0
 public RecycleList <T> IntersectList(ODBList <T> list)
 {
     return(this.hashSet.IntersectList(list.hashSet));
 }
コード例 #21
0
 public RecycleList <T> OperList(HSetOper oper, ODBList <T> list)
 {
     return(this.hashSet.OperList(oper, list.hashSet));
 }
コード例 #22
0
 public ODBForwardEnumerator(ODBList <T> list) : this(list.first)
 {
 }