public int CopyTo(T[] array, int arrayIndex, int count) { if (!this.any) { return(0); } ODBNode <T> oDBNode = this.first.item; int num = -1; if (count > this.count) { count = this.count; } while (true) { int num1 = num + 1; num = num1; if (num1 >= count) { break; } int num2 = arrayIndex; arrayIndex = num2 + 1; array[num2] = oDBNode.self; oDBNode = oDBNode.n.item; } return(num); }
protected bool DoRemove(ref ODBNode <T> node) { if (this.any && (node.list == this)) { this.hashSet.Remove(node.self); node.Dispose(); node = null; return(true); } return(false); }
protected bool DoRemove(ref ODBNode <T> node) { if (!this.any || node.list != this) { return(false); } this.hashSet.Remove(node.self); node.Dispose(); node = null; return(true); }
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 static ODBNode <T> New(ODBList <T> list, T self) { ODBNode <T> node; if (!ODBNode <T> .recycle.Pop(out node)) { node = new ODBNode <T>(); } node.Setup(list, self); return(node); }
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 bool DoAdd(T item) { if (!item) { throw new MissingReferenceException("You cannot pass a missing or null item into the list"); } if (!this.hashSet.Add(item)) { return(false); } ODBNode <T> .New(this, item); return(true); }
protected bool DoAdd(T item, out ODBNode <T> node) { if (item == null) { throw new MissingReferenceException("You cannot pass a missing or null item into the list"); } if (this.hashSet.Add(item)) { node = ODBNode <T> .New((ODBList <T>) this, item); return(true); } node = null; return(false); }
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); } }
public bool Pop(out ODBNode <T> o) { o = this.items; if (!this.any) { return(false); } if (--this.count == 0) { this.any = false; this.items = null; } else { this.items = o.n.item; } return(true); }
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 Push(ODBNode <T> item) { item.list = null; item.self = null; if (this.any) { item.n.item = this.items; item.n.has = true; this.items = item; this.count++; } else { item.n = new ODBSibling <T>(); this.items = item; this.count = 1; this.any = true; } }
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 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); } }
public int CopyTo(T[] array, int arrayIndex, int count) { if (!this.any) { return(0); } ODBNode <T> item = this.first.item; int num = -1; if (count > this.count) { count = this.count; } while (++num < count) { array[arrayIndex++] = item.self; item = item.n.item; } return(num); }
public void Push(ODBNode <T> item) { item.list = null; item.self = (T)null; if (!this.any) { item.n = new ODBSibling <T>(); this.items = item; this.count = 1; this.any = true; } else { item.n.item = this.items; item.n.has = true; this.items = item; ODBNode <T> .Recycler recycler = this; recycler.count = recycler.count + 1; } }
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 bool Pop(out ODBNode <T> o) { o = this.items; if (!this.any) { return(false); } ODBNode <T> .Recycler recycler = this; int num = recycler.count - 1; int num1 = num; recycler.count = num; if (num1 != 0) { this.items = o.n.item; } else { this.any = false; this.items = null; } return(true); }
public ODBForwardEnumerator(ODBNode <T> node) { this.sib.has = true; this.sib.item = node; this.Current = (T)null; }
public bool Contains(ODBNode <T> item) { return(this.any && (item.list == this)); }
public ODBForwardEnumerable(ODBNode <T> node) { this.sibling.has = true; this.sibling.item = node; }
public bool Remove(ref ODBNode <T> node) { return(base.DoRemove(ref node)); }
public bool Add(T item, out ODBNode <T> node) { return(base.DoAdd(item, out node)); }
internal ODBItem(ODBNode <TItem> node) { this.node = node; }
public ODBReverseEnumerable(ODBNode <T> node) { this.sibling.has = true; this.sibling.item = node; }
public ODBReverseEnumerator(ODBNode <T> node) { this.sib.has = true; this.sib.item = node; this.Current = null; }
public bool Contains(ODBNode <T> item) { return(!this.any ? false : item.list == this); }