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); }
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); } }
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); }
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); } }
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); } }
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); } }
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(); } } }
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(); } } } } }
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); } }
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); } } }
public ODBReverseEnumerator(ODBList <T> list) : this(list.last) { }
public RecycleList <T> UnionList(ODBList <T> list) { return(this.hashSet.UnionList(list.hashSet)); }
public RecycleList <T> SymmetricExceptList(ODBList <T> list) { return(this.hashSet.SymmetricExceptList(list.hashSet)); }
public void UnionWith(ODBList <T> list) { base.DoUnionWith(list); }
public void IntersectWith(ODBList <T> list) { base.DoIntersectWith(list); }
public ODBForwardEnumerable(ODBList <T> list) : this(list.last) { }
public void ExceptWith(ODBList <T> list) { base.DoExceptWith(list); }
public RecycleList <T> ExceptList(ODBList <T> list) { return(this.hashSet.ExceptList(list.hashSet)); }
public void SymmetricExceptWith(ODBList <T> list) { base.DoSymmetricExceptWith(list); }
public RecycleList <T> IntersectList(ODBList <T> list) { return(this.hashSet.IntersectList(list.hashSet)); }
public RecycleList <T> OperList(HSetOper oper, ODBList <T> list) { return(this.hashSet.OperList(oper, list.hashSet)); }
public ODBForwardEnumerator(ODBList <T> list) : this(list.first) { }