protected void DoExceptWith(ODBList <T> list) { if (!this.any || !list.any) { return; } if (list != this) { ODBSibling <T> oDBSibling = list.first; do { T t = oDBSibling.item.self; oDBSibling = oDBSibling.item.n; if (!this.hashSet.Remove(t)) { continue; } this.KnownFind(t).Dispose(); }while (oDBSibling.has); } else { this.DoClear(); } }
private void Setup(ODBList <T> list, T self) { ODBSibling <T> oDBSibling = new ODBSibling <T>(); this.self = self; this.list = list; this.hasList = true; this.n = new ODBSibling <T>(); if (!list.any) { list.count = 1; list.any = true; oDBSibling.has = true; oDBSibling.item = this; list.first = oDBSibling; list.last = oDBSibling; } else { this.p = list.last; this.p.item.n.item = this; this.p.item.n.has = true; list.last.item = this; ODBList <T> ts = list; ts.count = ts.count + 1; } }
private void Setup(ODBList <T> list, T self) { this.self = self; this.list = list; this.hasList = true; this.n = new ODBSibling <T>(); if (list.any) { this.p = list.last; this.p.item.n.item = (ODBNode <T>) this; this.p.item.n.has = true; list.last.item = (ODBNode <T>) this; list.count++; } else { ODBSibling <T> sibling; list.count = 1; list.any = true; sibling.has = true; sibling.item = (ODBNode <T>) this; list.first = sibling; list.last = sibling; } }
public bool MoveNext() { if (this.sib.has) { ODBNode <T> item = this.sib.item; this.Current = item.self; this.sib = item.p; return(true); } return(false); }
public bool MoveNext() { if (!this.sib.has) { return(false); } ODBNode <T> oDBNode = this.sib.item; this.Current = oDBNode.self; this.sib = oDBNode.p; return(true); }
protected ODBNode <T> KnownFind(T item) { ODBSibling <T> first = this.first; while (first.item.self != item) { first = first.item.n; if (!first.has) { throw new ArgumentException("item was not found", "item"); } } return(first.item); }
protected ODBNode <T> KnownFind(T item) { ODBSibling <T> oDBSibling = this.first; do { if (oDBSibling.item.self == item) { return(oDBSibling.item); } oDBSibling = oDBSibling.item.n; }while (oDBSibling.has); throw new ArgumentException("item was not found", "item"); }
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); }
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(); } } }
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 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 ODBForwardEnumerator(ODBSibling <T> sibling) { this.sib = sibling; this.Current = (T)null; }
public ODBForwardEnumerable(ODBSibling <T> sibling) { this.sibling = sibling; }
public void Dispose() { this.sib = new ODBSibling <T>(); this.Current = null; }
public ODBReverseEnumerable(ODBSibling <T> sibling) { this.sibling = sibling; }
public ODBReverseEnumerator(ODBSibling <T> sibling) { this.sib = sibling; this.Current = null; }