internal void InsertBefore(DoubleLink before)
 {
     this._prev       = before._prev;
     this._next       = before;
     before._prev     = this;
     this._prev._next = this;
 }
 internal void InsertAfter(DoubleLink after)
 {
     this._prev       = after;
     this._next       = after._next;
     after._next      = this;
     this._next._prev = this;
 }
        public bool MoveNext() {
            if (_current.Next == _list) {
                _current = null;
                return false;
            }

            _current = _current.Next;
            return true;
        }
Beispiel #4
0
 public bool MoveNext()
 {
     if (this._current.Next == this._list)
     {
         this._current = null;
         return(false);
     }
     this._current = this._current.Next;
     return(true);
 }
 public bool MoveNext()
 {
     if (this._current.Next == this._list)
     {
         this._current = null;
         return false;
     }
     this._current = this._current.Next;
     return true;
 }
Beispiel #6
0
        public bool MoveNext()
        {
            if (_current.Next == _list)
            {
                _current = null;
                return(false);
            }

            _current = _current.Next;
            return(true);
        }
        internal /*public*/ void Remove()
        {
            if (_current == null || _current == _list)
            {
                throw new InvalidOperationException();
            }

            DoubleLink t = _current;

            _current = _current.Prev;
            t.Remove();
        }
        internal /*public*/ DoubleLinkList RemoveSublist(DoubleLink head, DoubleLink tail)
        {
            DoubleLinkList list = new DoubleLinkList();

            head._prev._next = tail._next;
            tail._next._prev = head._prev;
            list._next       = head;
            list._prev       = tail;
            head._prev       = list;
            tail._next       = list;

            return(list);
        }
        /*
         * Inserts an entry and keeps the list sorted.
         *
         * @param entry
         */
        internal /*public*/ virtual void Insert(DoubleLink entry)
        {
            DoubleLink l;

            for (l = _next; l != this; l = l._next)
            {
                if (_comparer.Compare(entry.Item, l.Item) <= 0)
                {
                    break;
                }
            }

            entry.InsertBefore(l);
        }
 internal virtual void InsertTail(DoubleLink entry)
 {
     entry.InsertBefore(this);
 }
 internal virtual void InsertHead(DoubleLink entry)
 {
     entry.InsertAfter(this);
 }
 internal DoubleLinkListEnumerator(DoubleLinkList list) {
     _list = list;
     _current = list;
 }
 internal DoubleLink()
 {
     _next = _prev = this;
 }
Beispiel #14
0
 internal DoubleLinkListEnumerator(DoubleLinkList list)
 {
     _list    = list;
     _current = list;
 }
 internal void InsertBefore(DoubleLink before) {
     this._prev = before._prev;
     this._next = before;
     before._prev = this;
     this._prev._next = this;
 }
 internal void InsertAfter(DoubleLink after) {
     this._prev = after;
     this._next = after._next;
     after._next = this;
     this._next._prev = this;
 }
 internal DoubleLink() {
     _next = _prev = this;
 }
 internal /*public*/ override void InsertTail(DoubleLink entry)
 {
     throw new NotSupportedException();
 }
 internal virtual void InsertHead(DoubleLink entry) {
     entry.InsertAfter(this);
 }
 internal virtual void InsertTail(DoubleLink entry) {
     entry.InsertBefore(this);
 }
 internal void Remove() {
     this._prev._next = this._next;
     this._next._prev = this._prev;
     _next = _prev = this;
 }
Beispiel #22
0
 public void Reset()
 {
     _current = _list;
 }
Beispiel #23
0
 internal DoubleLinkListEnumerator(DoubleLinkList list)
 {
     this._list    = list;
     this._current = list;
 }
 internal DoubleLinkListEnumerator(DoubleLinkList list)
 {
     this._list = list;
     this._current = list;
 }
Beispiel #25
0
 internal /*public*/ void Remove()
 {
     this._prev._next = this._next;
     this._next._prev = this._prev;
     _next            = _prev = this;
 }
 public void Reset()
 {
     this._current = this._list;
 }
Beispiel #27
0
 internal /*public*/ DoubleLink()
 {
     _next = _prev = this;
 }
 internal DoubleLink()
 {
     this._next = this._prev = this;
 }
 public void Reset() {
     _current = _list;
 }
 internal void Remove()
 {
     this._prev._next = this._next;
     this._next._prev = this._prev;
     _next            = _prev = this;
 }
Beispiel #31
0
 public void Reset()
 {
     this._current = this._list;
 }